Closed tanasebutcaru closed 5 years ago
Hi @tbutcaru ,
Thanks a lot for the PR! Is there a way we can modify the original functions so that they can be used both with promises and without promises (something like what Bluebird does)?
Maybe you can extend the utility function you wrote to support this, and then modify the original function definitions to use that instead?
I'd also love to see some tests ensuring that the promise interface works as expected.
Hi @jviotti,
That is doable, but it will definitely take some time. I'll set a reminder for the next week and find some time to start doing that.
Closing this PR as I don't use this project anymore, hence no reason to work on it anymore.
Hello guys,
I've been using this electron package for few weeks and I really needed a better looking syntax, so I've created a wrapper over the actual
electron-json-storage
API.I thought it'll take too much to refactor the entire
storage.js
to replace callbacks with Promises, so I choose the fastest way of doing it. The only downside of this solution is that every time the API will change (new methods, changes to current methods), theasync.js
file will have to be updated too!Usage:
Note: everything works great, but the docs are not updated and there are no tests; consider this PR just a draft.
Let me know what do you think! Would you merge this as is or would you like to refactor the
storage.js
instead?Regards, Tanase B.