1.0.4 • Published 8 years ago

promise-handler v1.0.4

Weekly downloads
1
License
ISC
Repository
github
Last release
8 years ago

A simple promise handler to use when you find yourself turning the same function (err, result) {} to promises again and again and again.

Instead of:

return new Promise((resolve, reject) => {
    theLib.update(accountId, data, function(err, customer) {
        if (err) {
            return reject(err);
        }

        return resolve(customer);
    });
});

Do:

return swear(handler => {
    theLib.accounts.update(accountId, data, handler);
});
1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago