Disabled form state stored in localStorage

Daniel Steigerwald
1 min readJul 8, 2017

--

Is pretty dangerous pattern because if an app is terminated before the end of some async process, the form will be disabled forever. The same for every temporally value in app state.

We have to store disabled form fields state in local storage, to share app state across tabs. Separate local storage and session storage is possible, but hard to code without a lot of boilerplate.

We can filter app state after storage rehydration, but again, it’s error prone and hard to implement easily.

This is the approach I’m using in Este:

With temp wrapper, it’s almost impossible the developer accidentally forget to filter session only values.

If you like it, please donate.

--

--