| id | _injectStore |
|---|---|
| title | _injectStore |
function _injectStore<TState, TActions, TSelected>(
store,
selector,
options?): WritableStoreSliceSignal<TState, TSelected, TActions>;Defined in: packages/angular-store/src/_injectStore.ts:34
Experimental combined read+write injection function for stores, mirroring injectAtom's pattern.
Returns a callable slice with methods when the store has an actions factory, or with only the setState method for plain stores.
TState
TActions extends StoreActionMap
TSelected = NoInfer<TState>
Store<TState, TActions> | () => Store<TState, TActions>
(state) => TSelected
InjectSelectorOptions<TSelected>
WritableStoreSliceSignal<TState, TSelected, TActions>
// Store with actions
readonly dogs = _injectStore(petStore, (s) => s.dogs)
// dogs() and dogs.addDog()
// Store without actions
readonly value = _injectStore(plainStore, (s) => s)
// value() and value.setState(...)