DevYK 8466310f0c update README.md 3 gadi atpakaļ
..
LICENSE 8466310f0c update README.md 3 gadi atpakaļ
README.md 8466310f0c update README.md 3 gadi atpakaļ
index.js 8466310f0c update README.md 3 gadi atpakaļ
package.json 8466310f0c update README.md 3 gadi atpakaļ

README.md

co-wrap-all

Call co.wrap for multiple generator functions

This tiny helper allows to easily call co.wrap for multiple generator functions.
For example:

// Before
module.exports = {
    foo: co.wrap(foo),
    bar: co.wrap(bar)
};

// After
module.exports = wrapAll({foo, bar});

Also, it is very convenient for defining asynchronous methods:

// Common
class Foo {
    * bar(arg) { /* ... */ }
    * baz(arg) { /* ... */ }
}

// Before
Foo.prototype.bar = co.wrap(Foo.prototype.bar);
Foo.prototype.baz = co.wrap(Foo.prototype.baz);

// After
wrapAll(Foo.prototype);

License

MIT