Effect Store
Effect store is only found as the first argument to an effect
callback.
.state
Effect store is similar to the regular Store and you can access the current StoreState just like you can do in regular store by doing store.state
.
Signature:
store.state: StoreState;
Example:
key.effect(store => {
store.state // StoreState
})
.dispatch()
Effect store has a dispatch
method that can be used to dispatch actions to the store.
Signature:
store.dispatch(transaction: Transaction): void;
Arguments:
transaction
- A Transaction object that describes the action to be dispatched.
Example:
key.effect(store => {
store.dispatch(slice.someAction());
})