techies
v1.0.2
Published
generator based control flow
Downloads
3
Readme
Generator based control flow
Installation
$ npm install techies
Examples
var techies = require('techies')
techies.co(function*() {
var data = Promise.resolve(1)
var data2 = Promise.resolve(2)
var res = {
1: yield data,
2: yield data2
}
console.log(res)
}).then(...)
var get = techies.async(function*() {
var data = Promise.resolve(1)
var data2 = Promise.resolve(2)
var res = {
1: yield data,
2: yield data2
}
console.log(res)
})
get() // call generator engine
API
- techies.co(generator) => return a promise
- techies.async(generator) => return generator engine
License
(The MIT License)