Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



It's not in the linked documentation, but localForage does support promises. https://github.com/mozilla/localForage#promises


Thanks for pointing this out; I've filed an issue to add them: https://github.com/mozilla/localForage/issues/218


It 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.


probably best to prioritize de facto standards over your own personal aesthetic preferences.


Fair 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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: