Re:LocalForage – A fast and simple storage library for JavaS...
by cplantijn on Tuesday January 17, 2017 @08:13PM
(#13423172)
While I am fascinated by this, what are some good use cases for using offline storage? How can a web-enabled browser app benefit from offline storage? I've come to appreciate the power that client-side stores like what Redux and MobX provide, but what's the benefit and use case of using this?
[ Parent
| on HN ]
Re:LocalForage – A fast and simple storage library for JavaS...
by Klathmon on Wednesday January 18, 2017 @06:44AM
(#13425681)
We actually use localforage as a backing store to "persist" parts of the redux store automatically.
The app itself is a freight logistics tracking and scanning app which is meant to download and store a few hundred MB of carton data and be able to scan and process it offline and sync back to a server when online again.
With redux-persist and localforage it's been effortless to enable this. Parts of our store are whitelisted and are persisted to localforage every 300ms or so. When the app is loaded the next time it pulls the data from localforage and "rehydrates" the store with it so it's like we never left the page in question.
Re:LocalForage – A fast and simple storage library for JavaS...
by findjashua on Tuesday January 17, 2017 @08:22PM
(#13423215)
This is good for storing data across sessions, whereas Redux/MobX lose data once the user closes the tab.
Re:LocalForage – A fast and simple storage library for JavaS...
by pipu on Wednesday January 18, 2017 @02:46AM
(#13424798)
You usually use localStorage for e.g. user settings that are not stored on the server. There are many sites that give you the possibility to change a preference or two without the need for an actual account on the site. That sort of information is usually stored in one of the client-side storages.
Re:LocalForage – A fast and simple storage library for JavaS...
by Thomas_9 on Wednesday January 18, 2017 @05:18AM
(#13425318)
I think Splitons is a good example of an App using rightly Local storage combined with AppCache : splitons.com
It keep tracks of expenses offline and sync states when you have connectivity again.