Hexagon / node-telldus

Node bindings for telldus-core
Other
34 stars 10 forks source link

What about promises instead of callbacks? #17

Open nilzen opened 10 years ago

nilzen commented 10 years ago

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

Hexagon commented 10 years ago

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 :)

kmpm commented 10 years ago

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.

nilzen commented 10 years ago

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!

kmpm commented 10 years ago

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

Hexagon commented 10 years ago

Check :)

nilzen commented 10 years ago

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

kmpm commented 10 years ago

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

Hexagon commented 8 years ago

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