Is it possible to access a different state within a action?
Scenario: I have two states:
- FilterState
- AppState
FilterState
contains an action Filter
, when the filter action is triggered, then the filterService
is called with the payload of the action + with a value from the AppState
.
@Action(Filter)
filter(ctx, action) {
// HOW TO GET VALUE FROM AppState
return this.filterService.filter(action, valueFromOtherStore).pipe(
tap(data => {
// Do something with result
})
);
}
How is it possible to retrieve values from a different state to apply this value to the second param of this.filterService.filter
?