I load some information from my API to the state on page load. I filter the data, maybe some pagination, sorting, etc. I leave the page and come back. The state still has the old data briefly before getting the default data again (without the filtering).
Should I be removing the state data on navigate away (back to initial state), or maybe just flagging it back to a loaded of false? Is there some standard accepted way to handle this type of issue? Should I be handling this in the initial get request action, or something in a resolver?
Normally I would think this type of question is not Stack Overflow friendly since it doesn't point to one specific answer necessarily, but I assume there is some ngrx recommended way to handle this.
Part of the benefit of the store is to be able to save a state snapshot and populate the view with the snapshot while getting the new data. This allows the user to see and use the view prior to getting the latest information.
This may or may not be desired and as you've pointed out you might want to flush the state/store and always get new data in that view.
Or you may want to enhance your store so that you also maintain filters and show the last info you had available for the user.