pco

0.0.2 • Public • Published

pco

Shortcuts for Bluebird's Promise.coroutine

Example

const P = require('pco');

const f = P.co(function* () {
  yield P.delay(2000);
  return 10;
});

f().then(console.log);

Or:

const { P, co } = require('pco');

const f = co(function* () {
  yield P.delay(2000);
  return 'pco';
});

f().then(console.log);

TODO

Add better docs

Package Sidebar

Install

npm i pco

Weekly Downloads

0

Version

0.0.2

License

MIT

Last publish

Collaborators

  • rsp