src/generators.js
// Construct a function to control the generator
Construct a function to control the generator
Construct a function to control the generator
function iterateGenerator(gen) {
	var generator = gen();
	var ret;
	(function iterate(val) {
		ret = generator.next();
		if(!ret.done) {
			ret.value.then(iterate);
		} else {
			setTimeout(function() {
				iterate(ret.value);
			});
		}
	})(); 
}
function iterateGenerator ( gen ) { var generator = gen ( ) ; var ret ; ( function iterate ( val ) { ret = generator . next ( ) ; if ( ! ret . done ) { ret . value . then ( iterate ) ; } else { setTimeout ( function ( ) { iterate ( ret . value ) ; } ) ; } } ) ( ) ; }
Construct a function to control the generator
Construct a function to control the generator