bigBear713 / nb-common

Some common component, pipe, service based on angular.
https://bigbear713.github.io/nb-common/
MIT License
41 stars 6 forks source link

Return the old subscription when calling collectASubscriptionByKey function #30

Closed bigBear713 closed 1 year ago

bigBear713 commented 1 year ago

version: v16.0.0

We know that calling NbUnsubscribeService.collectASubscriptionByKey() can collect a new subscription via a key. And if there is a subscrption matching the key before adding the new subscription, we can auto unsubscribe it. But now, we can't get the exist one regardless of whether the subscription is auto unsubscribed or not, I don't think it is good. It is better if we can get the exist one so we can know has it been unsubscribed, decide when to unsubscribe it.

So I think it is better if the collectASubscriptionByKey function can return the subscription if it exists when calling it

bigBear713 commented 1 year ago

It is provided in v16.1.0