ng-turkey / ngxs-reset-plugin

Reset plugin for NGXS: Effortlessly clears, resets, or overwrites NGXS states respecting the state tree.
https://stackblitz.com/edit/ngxs-pizza
MIT License
108 stars 8 forks source link

Support lazy module #15

Closed ThibaudAV closed 5 years ago

ThibaudAV commented 5 years ago

Is your feature request related to a problem? Please describe.

If the reset is done after loading the lazy module, it is also necessary to reset the state with their initial state. Otherwise the actions of the lazy module will no longer work

Describe the solution you'd like

Use the UpdateState action in addition to InitState in ResetHandler to add the lazy initial state in resetService.initialState 🤔

Describe alternatives you've considered 💭

Additional context In my application I have to change entities. When changing entities I would like to reset the state of the application (expert routerState and authState). My application contains many lazy modules ^^