Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70762

Avoid AsyncPipe?

$
0
0

@ddowns wrote:

The Ionic Angular lifecycle docs recommend using ionViewWillLeave for cleaning up observables.

ionViewWillLeave - Can be used for cleanup, like unsubscribing from observables. Since ngOnDestroy might not fire when you navigate from the current page, put your cleanup code here if you don’t want it active while the screen is not in view.

This seems contradictory to the Angular best practice of using the AsyncPipe in templates to handle the subscription logic of the observable. Is it recommended to avoid using AsyncPipe for Ionic apps, since it only unsubscribes when the component is destroyed?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70762

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>