You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which @ngneat/effects-* package(s) are the source of the bug?
effects-ng
Is this a regression?
No
Description
Effects directive only unregisters last effect for each effect provider. The other effects keep running even after the component with the directive are destroyed.
The below uses the instance as the key, which results in each additional effect in the loop overriding the last entry.
During unregister sourceInstancesWithProvidersEffectsTokens is used to identify which effects to unregister. While there might be multiple providers in the set, there is always only one effect entry associated with each provider.
Which @ngneat/effects-* package(s) are the source of the bug?
effects-ng
Is this a regression?
No
Description
Effects directive only unregisters last effect for each effect provider. The other effects keep running even after the component with the directive are destroyed.
The below uses the instance as the key, which results in each additional effect in the loop overriding the last entry.
effects/libs/effects-ng/src/lib/use-directive-effects.ts
Line 70 in da32a41
During unregister
sourceInstancesWithProvidersEffectsTokens
is used to identify which effects to unregister. While there might be multiple providers in the set, there is always only one effect entry associated with each provider.effects/libs/effects-ng/src/lib/use-directive-effects.ts
Line 96 in da32a41
Please provide a link to a minimal reproduction of the bug
This can be reproduced by adding additional effects to the effect providers in the unit tests.
Please provide the exception or error you saw
Please provide the environment you discovered this bug in
No response
Anything else?
No response
Do you want to create a pull request?
Not sure if I understand the codebase enough to ensure I don't brake the other feature "an effect will always only run once"
The text was updated successfully, but these errors were encountered: