V4 navigating params with providers is cool...but what about refresh in a #pwa

Hey,

So I’m a big fan of using providers to navigate in an Ionic v4, simple, easy to migrate, etc. but, do you know how to handle a page refresh in case of pwa?

For example, if user click refresh, then the provider will be empty, a new instance will be constructed => no more navigation params in memory => what to do?

Spontaneously I thought about using storage instead of provider to save the params

Or catch the error in a ErrorHandler and redirect to the root page where no params are needed

Or any other idea?

I implemented the following idea: In my provider, I check if the params are set or empty, if set all good, if empty or null, like when the user refresh the browser page, I use a Subject to emit a route which I’m listing to in app.component.ts in order to redirect to the page of my choice respectively often the page before the page where I need the params

Maybe it would be better to save the params in the storage, because doing so the user would not be redirected, but it’s better than displaying errors :wink: