Closed schnippe closed 9 years ago
@schnippe would this force users into using promises? If so, creating a "promisified" version that wraps the currently library makes more sense.
@sandeepmistry No, it would not force users into using promises. But it would enforce using a single api style like
SensorTag.discover (param1, param2, callback) // with callback(error, result1, result2)
It would possibly mean maintaing a part of the api-signature twice, too.
Are you interested?
@schnippe error parameters for callbacks have been added to master.
@schnippe any progress on this, now that callback have error parameters?
Closing for now due to lack of activity/interest.
Hi Sandeep,
would you accept a pull request for compatibility to promises and harmony generators? This would help out of the callback hell and look pretty nice. Harmony Generators are supported in node 0.12 I am thinking about making a Promise Wrapper around the node-sensortag API or forking it. I will retain node 0.10 compatibility.
Test.js could look like this or even shorter: