4 ms·
In general, projects like these are great — they unify a lot of underlying architecture and, with time, can make them ubiquitous to use. LocalForage[1] is a gre
by Etheryte 7y ago
In general, projects like these are great — they unify a lot of underlying architecture and, with time, can make them ubiquitous to use. LocalForage[1] is a great example of this, and I would recommend using that over regular local storage for every serious web project.
This project raises my eyebrows at two technical points, though:
There is no mention of "Promise" or "async/await" in the readme. I know the project tries to mirror the current Node filesystem, but that also offers Promises[2] — something I would call the industry standard for writing readable async code these days. Despite being in beta, I would argue that this project should also aim to support Promises over nested callback pyramids as the default pattern.
Secondly, maybe I'm just not familiar with the idea, but I'm very sceptical of the AsyncMirror backend — when you use an asynchronous service synchronously, how do you guarantee all writes are flushed before the user leaves the page?
Other than that, a project of this scale is no small feat, so godspeed to all contributors.
[1] https://github.com/localForage/localForage https://github.com/localForage/localForage
[2] https://nodejs.org/dist/latest-v10.x/docs/api/fs.html#fs_fs_promises_api https://nodejs.org/dist/latest-v10.x/docs/api/fs.html#fs_fs_...
- drenvuk 7y agoDoes es6-promisify solve your first concern? The callbacks are definitely a pain.
- jbob2000 7y agoIt’s straightforward and quick to write a promise wrapper on callbacks. If one of the goals of the project is interoperability, then it makes sense to leave async/promise implementations to the user.