1.1.1 • Published 8 years ago

roads-coroutine v1.1.1

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

roads-coroutine

A simple library to turn javascript generators into promise-returning functions.

Examples

var cr = require('roads-coroutine');

var fn = cr(function* (param) {
  var result = yield promiseReturningAsyncFunction(param);
  return "final result: " + result;
});

fn('hey!').then(function (response) {
  console.log(response);
}, function (err) {
  console.log(response);
});

The tests have even more examples!

Warning

There are versions of iojs pre-2.5.0 that can generate false "unhandled rejection" events. Please make sure you are using at least 2.5.0

1.1.1

8 years ago

1.1.0

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago