futurice/pepperoni-app-kit

What is the easiest way to clear state?

Opened this issue · 2 comments

Silly question, but when you change just about anything in the sample, e.g. the name of the key for one of your navigation screens, the app won't run anymore (red screen) because the navigator is reading a state value from the store that the app does not understand.

Given the app doesn't run in this state, you can't use the developer menu Clear State function, so what is the simple trick for quickly clearing state in this case?

I've been renaming the APP_STORAGE_KEY to force a new initial state, but I must be missing a simple trick you all must be using.

Glad I am not the only one experiencing this, especially with the Navigation structure - this might get really tricky with app Updates. Did you find any solution for this?

At least the action RESET_STATE does exactly what we need. But I guess we need to hook this into the navigation state so that it dispatches this action in case it would fail otherwise.