Meta Reducers
Last updated
Last updated
A meta reducer is a higher order reducer that allows you to take action on the global state rather than a state slice. In NGXS, we don't have this concept but you can accomplish this with .
An example of a meta reducer might be to clear the entire state when a user logs out. An example implementation would be:
Then add it to provideStore
features:
Now when we dispatch the logout action it will use our new plugin and erase the state.