I need to know how to create a listener e.g. I want to subscribe to the AppState changing.
Below is my current very basic service. I have a dispatch action on the vi
angular-redux offers a very convenient way of selecting slices of your store with the @select() decorator.
Let's say your IAppState would be:
export interface IAppState {
counter: number;
auth: {token: string};
}
Then you can select the parts of your state like this:
// variable name is equal to state property + $
@select() counter$: Observable;
@select() auth$: Observable<{token: string}>;
// path to store slice
@select(['auth', 'token']) token$: Observable;
For further information, have a look at the select docs.