Skip to content

Instantly share code, notes, and snippets.

@riversun
Created April 13, 2017 02:16
Show Gist options
  • Save riversun/84735e382e58853c235a52eb8140c882 to your computer and use it in GitHub Desktop.
Save riversun/84735e382e58853c235a52eb8140c882 to your computer and use it in GitHub Desktop.
Snipet of Tehnnable(Promise) Method prototype
/**
* Thennable Method(prototype)
* @param myObject
* @returns {Promise}
*/
MyClazz.prototype.method = function (myObject) {
var me = this;
return new Promise(function (resolve, reject) {
var result = {res: myObject};
resolve(result);
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment