Zolmeister / promiz

A polyfill for ES6-style Promises in 913 bytes (gzip)
MIT License
102 stars 11 forks source link

generators approach? #7

Closed tunnckoCore closed 10 years ago

tunnckoCore commented 10 years ago

Suggestions? Or only .then to accept generator functions?

Zolmeister commented 10 years ago

No plans to support es6 generator functions yet. I assume you're referring to the async/await es7 style functionality, which has not been standardized yet.

tunnckoCore commented 10 years ago

Mm nope, exactly. Refer something like this

.then(function * (filename) {
  return JSON.parse(yield readFile(filename, 'utf8'))
})
.then(function * (jsonData) {
  console.dir(jsonData)
}, console.error)
Zolmeister commented 10 years ago

Ah, gotcha. Unfortunately no plans to do that anytime soon.