thenerize
v1.0.2
Published
Creates methods suitable for passing to then callbacks in promise chains
Downloads
3
Readme
thenerize
thenerize walks the passed in objects prototype chain and creates methods suitable for using in a promise chain. The methods take on the same name as the original method with a prefix of 'then', and the first letter of the name capitalized if it's not already.
Install
npm install --save thenerize
Usage
const thenerize = require('thenerize');
var promise = new Promise((resolve, reject) => {
resolve();
});
thenerize(console);
promise
.then(console.thenLog('hello world'));
// will print hello world when promise resolves