Get all current (active) subscriptions

后端 未结 7 1283
清歌不尽
清歌不尽 2021-02-12 20:58

Is it possible to get all the \"active\" subscriptions without storing them manually?

I\'d like to unsubscribe all of the \"active\" subscriptions and don\'

7条回答
  •  独厮守ぢ
    2021-02-12 21:36

    The easiest way is to make use of ngx-auto-unsubscribe. With this decorator you shouldn't put the unsubscribe(), this is done automatically.

    For use this you only need declare onDestroy, you don't need to put anything in this.

    It is very easy to use, I encourage you to use it.

    Npm installation

    Official documentation

提交回复
热议问题