Our blog is fast to load since we have integrated Redux into it, however, our users still have to wait three seconds for the initial load. What if we could persist the Redux store offline and show it to users while the new data is loading?
Sounds good, and it's very simple too! I have already added two libraries to the dependencies list for this purpose:
- redux-persist: https://github.com/rt2zz/redux-persist
- localForage: https://github.com/localForage/localForage
redux-persist provides a simple way to persist your Redux store and rehydrate it whenever needed. This makes your store available offline when your users visit your page for the second time.
localForage is a simple storage library that lets you use indexDB ...