databox/databox-js

can you please promisify this

Opened this issue · 5 comments

can you please promisify this

Very much agreed. This doesn't really follow the normal callback pattern (returning an error) or the promise pattern. It's pretty difficult to handle errors.

Just wanted to +1 this issue and mention there's still some desire out there for this type of enhancement 😄

We are happy to accept any PR moving this forward.

I will take a stab at it this week - no promises! Actually, promises will likely be involved.. you know what I mean 😉

Hi there, just an update - I did spend some time working on this. It looks to be a good bit of work, and I ran into quite a few little things here and there that I wasn't sure about. The test suite overrides the _pushJSONRequest prototype instead of exercising the one exported from the main lib (which I'm sure is intentional) but it leaves me having trouble understanding how to ensure the integrity of the api parts after making changes without making significant modifications to both the lib and test suite. I think it may be over my head, I'm sorry - was hoping to be able to knock this out for you guys but I think it's more than I can do in isolation. I was thinking it was just a matter of wrapping the calls in Promise interface, which I've done many times, but this one got the best of me for the moment. Just wanted to mention so nobody is waiting/expecting a PR from me on this one. Sorry I couldn't be of more help on this one :/ I may try again at some point in the future in case I find more time and nobody beats me to it. Until then, best of luck!