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

After Angular 14 upgrade some of the states are not reset but removed entirely after dispatching StateResetAll #75

Closed alexw10 closed 2 years ago

alexw10 commented 2 years ago

Seems to not be working with Angular 14 is there plans to update this?

armanozak commented 2 years ago

Why do you think that? I have updated the StackBlitz demo to Angular 14 and it works. I also had a production build and it was successful. Have you faced any specific problems using it with Angular 14?

alexw10 commented 2 years ago

Will have a coworker of mine respond with more specifics shortly @armanozak

ghost commented 2 years ago

Hey @armanozak . We were upgrading from Angular 13 to Angular 14 and ran into an issue where some of the states are not reset but removed entirely after dispatching StateResetAll(). We pass 2 states to maintain into StateResetAll(), but there are 2 other states that are cleared and not added back to the state with their default values.

armanozak commented 2 years ago

Thank you @Cnelly611. I have been able to reproduce the problem and can confirm it does not exist in Angular 13.

We will work on the issue and try to fix it. In the meantime, please use StateReset instead. I know it is not as convenient as StateResetAll, but this may take some time.

ghost commented 2 years ago

Thank you for working on this @armanozak. We appreciate your work :)

mkubik-tm commented 2 years ago

Thanks for this plugin! Any ETA on this issue though? I can't really use StateReset, because of some lazy loaded states and modules that I can't import when resetting the store. Will need to listen for action dispatched / completed and fire the StateReset separately for each of these feature modules.

armanozak commented 2 years ago

Hi @alexw10, @Cnelly611, @mkubik-tm,

Sorry for the delay. We have fixed the problem and released v3.0.0. The change requires Angular 14+, hence the major release.