All Global State reset on page refresh
ardiansyaherwin opened this issue · 1 comments
ardiansyaherwin commented
Hi, sorry if this has already answered somewhere. But I’d like to know if this package support to keep the global state on page refresh.
Or maybe I was doing something wrong with the initialization?
quisido commented
ReactN does not persist state. That is out of scope for the package, because it would be done differently in different environments: for example, React DOM and React Native would be two different persist solutions. ReactN is more analogous to React itself, not the environment specific implementation.
ReactN does offer the addCallback
helper function that would allow persisting state, by storing it whenever the global state updates.
A few third party packages already do this: