node-telldus
node-telldus copied to clipboard
What about promises instead of callbacks?
Any thoughts @Hexagon @kmpm ? Can't think of an issue to have both though...
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 :)
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.
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!
I would possibly move this to a later milestone and get node style callbacks stabilized first.
Check :)
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
It's no question about doing it or not, if you ask me. It's a matter of time :)
Removed milestone, it will be implemented when someone submit a pull request :)