4 ms·
Ugh it would have been nice if they had settled on a standard async api E.g. Node style callbacks or promises instead of their own random one. Edit: it would b
by cwmma 12y ago
Ugh it would have been nice if they had settled on a standard async api E.g. Node style callbacks or promises instead of their own random one.
Edit: it would be nice if the documentation mentioned the promise support.
- anotherbrick 12y agoIt's not in the linked documentation, but localForage does support promises. https://github.com/mozilla/localForage#promises https://github.com/mozilla/localForage#promises
- tofumatt 12y agoThanks for pointing this out; I've filed an issue to add them: https://github.com/mozilla/localForage/issues/218 https://github.com/mozilla/localForage/issues/218
- tofumatt 12y agoIt uses Promises and callbacks, though you're right it doesn't use node-style. It's not a node library and I frankly dislike needing to supply error as a first arg, as strictly speaking it's optional and just adds cruft. I had a few folks mention this in the early stages of library development but it hasn't come up since.
- woah 12y agoprobably best to prioritize de facto standards over your own personal aesthetic preferences.
- tofumatt 12y agoFair enough, I've asked the contributors/users what they think and am open to making the change for 1.0: https://github.com/mozilla/localForage/issues/219 https://github.com/mozilla/localForage/issues/219