Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49087

Can you make the Ionic lifecycle methods (e.g, `ionViewWillEnter`) async?

$
0
0

Just tried it: declared

    public async ionViewWillEnter(): Promise<void> {
        ....
    }

in my component, instead of the usual

    public ionViewWillEnter(): void {
        ....
    }

… because in this case the code is easier to follow with the async / await way of writing it.

ionViewWillEnter seems to work just fine when declared async - it still gets called and runs as it used to.

If there is anything wrong that you see or any risk with declaring the Ionic lifecycle methods as async, please holler, thanks!

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 49087

Trending Articles



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