var genbind = require('generator-bind');
function* myGen(i) {
console.log('myGen',this.x, i);
}
//myGen = genbind({x:666}, myGen);
myGen(9).next();
The code above echos myGen undefined 9 as expected.
var genbind = require('generator-bind');
function* myGen(i) {
console.log('myGen',this.x, i);
}
myGen = genbind({x:666}, myGen);
myGen(9).next();
The code above echos myGen 666 undefined, I was expecting myGen 666 9.
I'm wondering if I'm using this module incorrectly?
The code above echos
myGen undefined 9as expected.The code above echos
myGen 666 undefined, I was expectingmyGen 666 9.I'm wondering if I'm using this module incorrectly?