If you want to publish a module that has sequenced IO, is it ever OK to write,
./sequenced_actions.js
module.exports = function * () {}
Thereby permitting something like,
co( function * {
yield require('./sequenced_actions');
} )();
If you want to publish a module that has sequenced IO, is it ever OK to write,
./sequenced_actions.js
module.exports = function * () {}
Thereby permitting something like,
co( function * {
yield require('./sequenced_actions');
} )();
if you want your modules to reach the largest audience possible, just write them in promises. hopefully node v0.12 will have native promises, so this will make things easier
Yes, it's okay to do that.
Generator function is just an ordinary function under the hood. And since node.js allows an arbitrary value to be exports object of a module, you can export whatever you want there.