|
|
|
|
|
by vanderZwan
3400 days ago
|
|
Since I assume both have their pros and cons, when would I want to use Store.js, and when would I want to use localForage[0]? I'm asking as someone who has offline storage planned for an app, but has yet to get around to it. I'd like to know which one is probably best for my needs :) [0] https://github.com/localForage/localForage |
|
Check back in coming days for more details.
Store.js will soon have pluggable support for localForage (either by implementing similar functionality in separate storages, or by simply adding a pluggable storage which uses localForage under the hood).
There are a few benefits to using store.js, such as full cross-browser support and useful plugins, but the biggest meaningful value-add over localForage is probably the availability of a synchronous API that allows you to read and write values without callbacks, promises, etc.
In my experience you only want to use asynchronous APIs when you have to, since they add a fair amount of complexity, are a common source of errors, and are harder to debug properly.
But yeah, check back later and you'll likely find that store.js supports the same storages as localForage, in addition to the its other functionality.