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

Extend use-cases for custom destroy method #66

Closed
artaommahe opened this issue Mar 29, 2020 · 6 comments
Closed

Extend use-cases for custom destroy method #66

artaommahe opened this issue Mar 29, 2020 · 6 comments

Comments

@artaommahe
Copy link

artaommahe commented Mar 29, 2020

With current custom destroy method implementation there are some issues

Playground for both cases here
https://ng-run.com/edit/LxkqzZQCoAv8i1KRl7Uj?open=app%2Fsome.service.ts

  • having two destroy methods (for different streams) and calling one of them completes all other streams

    • press start
    • press start2
    • see two intervals in console
    • press either stop or stop2
    • both intervals complete (should complete only one)
  • cannot use operator for start-stop case when you need to unsubscribe (after new subscriptions) multiple times during service lifetime

    (only first start/stop buttons now)

    • press start
    • press stop
    • press start again
    • press stop again
    • interval does not complete

It's real world use-cases from our apps where are a lot of such singleton services with start/stop methods for some pages business-logic.

@arturovt
Copy link
Collaborator

arturovt commented Mar 29, 2020

@artaommahe Hey. I've published @7.1.3, could you give it a try?
I've bumped version in that playground you've provided here and it seems to be working.

@artaommahe
Copy link
Author

@arturovt second case is fixed, thx. First one is still here - calling one of the destroy methods complete every stream, even that is bound to other destroy method

@arturovt
Copy link
Collaborator

Thanks for clarifying, will look tomorrow.

@arturovt
Copy link
Collaborator

@artaommahe @7.1.5 has been published.

@arturovt
Copy link
Collaborator

@artaommahe If you find a time to check it and it works then close the issue, or ping me here if you find another one. Cheers.

@artaommahe
Copy link
Author

@arturovt it works, thank you. Finally we can replace our local operator with until-destroy lib )

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

No branches or pull requests

3 participants