Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(effects-directive): unregister all effects of a provider #73

Merged
merged 2 commits into from
Jul 1, 2024

Conversation

ntziolis
Copy link
Contributor

@ntziolis ntziolis commented Jul 1, 2024

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?
Ensures correct behavior of directive when on destroy is called

[x] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

Only the last (order) effect in a provider was unregistered.

Issue Number: #72

What is the new behavior?

All effects are of a provider are unregistered.

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

Copy link

stackblitz bot commented Jul 1, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@NetanelBasal
Copy link
Member

@EricPoul can you please review this?

@ntziolis
Copy link
Contributor Author

ntziolis commented Jul 1, 2024

Please let me know if you feel I should add additional unit tests. I added just enough to make them fail (multiple effects in a single provider). And the added a fix and retested.

@EricPoul
Copy link
Collaborator

EricPoul commented Jul 1, 2024

LGTM

No need for an extra test. Just check that spy3 is called the same number of times as spy1 in the existing tests.

@ntziolis
Copy link
Contributor Author

ntziolis commented Jul 1, 2024

No need for an extra test. Just check that spy3 is called the same number of times as spy1 in the existing tests.

Done. That said I used spy3 to cover some additional edge cases instead of just mirroring spy1.

@EricPoul
Copy link
Collaborator

EricPoul commented Jul 1, 2024

Thank you for the fix!

@EricPoul EricPoul merged commit ce07658 into ngneat:master Jul 1, 2024
1 check passed
@ntziolis
Copy link
Contributor Author

ntziolis commented Jul 1, 2024

One note. While I would not consider this a breaking change as such, since it just ensures the expected behavior. It does change significantly how the directive functions and might affect existing apps in a way that might not be easy to see for other devs. Not sure what the right way would be to go about this.

@EricPoul
Copy link
Collaborator

EricPoul commented Jul 1, 2024

It should be fine generally. If someone faces a problem, it's because their code has worked wrong. While it is breaking change in some way, I don't see a problem.

@EricPoul
Copy link
Collaborator

EricPoul commented Jul 4, 2024

@NetanelBasal I created a tag and updated version but it still isn't available for downloading/ Could you check what I missed?

@NetanelBasal
Copy link
Member

I need to publish it

@NetanelBasal
Copy link
Member

Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants