qize
Converts asynchronous functions to [Q(https://github.com/foo/q)] promises
Installation
Easily via npm.
npm install qize --save
Usage
var qize = ; var { ;}; // It returns a [Q(https://github.com/foo/q)] compatible version of `sum`.var sumPromised = qize; Qall
API
qize.getPromised
requires exactly one function as argument. The last argument of given function needs to be a callback, it will be appended when calling the Promised one.- The callbacks first argument is required to be an error or non-positive.
The logical result is:
{ var deferred = Qdefer; ; return deferredpromise;}
Examples
Use it for your prototype methods
var { this_private = 5;}; TestClassprototype { var result = num + this_private; ;}; // It binds `this` gracefullyTestClassprototypesomeAsyncPromised = qize; var test = ; test; // <- sum is 11
Provide Q and vanilla callbacks in your classes
'loadX' 'doThat' 'makeIt' 'saveIt';
LICENCE
See LICENCE file