Handle tabs caching and logout


i’m developing an Ionic5 App based on tabs. As far as i understand, the caching mechanism under tab view works calling ngOnInit of a tab component only the first time entering in that state, and this is perfect for me.
The problem is that after a logout, i want to “clear” that cache to call again ngOnInit of tabs after login.

What is the best approach to archive this?

My suggestion is here, which should allow you to achieve your underlying goal without abusing lifecycle events.

thanks for the reply, but i think i needed a simpler solution.
I end up using NavController.navigateRoot after logout/login to clear the cache and handle correctly back button on Android.