cb-promise
Allow your methods be called by Callbacks or Promises.
Examples:
The use of this module is very simple and useful.
var cbPromise = ; // Create your methods with a optional callback parametervar { var data = 'important data'; return ;};
Yes, that's it. Now you can call your method using callback or promise
Using Callbacks:
;
Using Promises:
Handling Errors
There are no differences with the examples above.
var cbPromise = ; // Create your methods with a optional callback parametervar { var error = 'error occurred'; return ;};