ng-turkey/ngxs-reset-plugin

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

alexw10 opened this issue · 7 comments

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

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?

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

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.

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.

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

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.

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.