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
Is it possible to trigger a complete event on destroy component?
I think it could be a nice feature in order to avoid manual unsubscriptions.
Have a nice day!
Miguel
The text was updated successfully, but these errors were encountered:
Thank you for your request! At the moment, all the decorators are unaware and independent from the Angular lifecycles.
The main usage idea of the ngx-propserve library is to use it by following the SIP Principle, so the source streams are combined, by using the available rxjs operators, to create presentation streams that are consumed in the template. To extract the results of the stream, Angular provides the AsyncPipe, which unsubscribes the subscription of the piped stream automatically, when the component is destroyed.
That being said, I agree that internal subscriptions in the component are also a valid use case. What would be your idea on how to implement it, then? I could think of the decorator overwriting the ngOnDestroy function, so that the observed properties are completed when ngOnDestroy is being called. Probably, the component does not need to explicitly implement OnDestroy, so that ngOnDestroy is called by the Angular Engine when the component is destroyed. I think until-destroyed uses it this way as well.
Hi Aleics!
Is it possible to trigger a complete event on destroy component?
I think it could be a nice feature in order to avoid manual unsubscriptions.
Have a nice day!
Miguel
The text was updated successfully, but these errors were encountered: