node-telldus icon indicating copy to clipboard operation
node-telldus copied to clipboard

What about promises instead of callbacks?

Open nilzen opened this issue 11 years ago • 8 comments

Any thoughts @Hexagon @kmpm ? Can't think of an issue to have both though...

nilzen avatar Dec 15 '13 17:12 nilzen

As the promises is dropped in node (According to http://howtonode.org/promises) i would prefer the standard way. But if it doesn't cause any overhead (and someone find the time to implement it) I guess we could support both styles :)

Hexagon avatar Dec 15 '13 17:12 Hexagon

I like promises alot.... using https://github.com/kriskowal/q for example. But perhaps later and definitely not replacing normal callbacks. I would be happy if we could get those sorted out first. Promises is just adding some logic to the wrapper in it's simplest form.

kmpm avatar Dec 15 '13 17:12 kmpm

It feels like its trivial to add, I can look in to it later. Regarding that promises were dropped in Node 0.2, so would I have done with that syntax (attaching to events). The Q way of doing it with chainable code is much nicer!

nilzen avatar Dec 15 '13 17:12 nilzen

I would possibly move this to a later milestone and get node style callbacks stabilized first.

kmpm avatar Dec 17 '13 07:12 kmpm

Check :)

Hexagon avatar Dec 17 '13 07:12 Hexagon

I haven't got time to look in to this now, but more and more ppl are moving towards promises in node as well http://spion.github.io/posts/why-i-am-switching-to-promises.html

nilzen avatar Jan 07 '14 21:01 nilzen

It's no question about doing it or not, if you ask me. It's a matter of time :)

kmpm avatar Jan 08 '14 09:01 kmpm

Removed milestone, it will be implemented when someone submit a pull request :)

Hexagon avatar Feb 02 '16 12:02 Hexagon