Package Exports
- async-iterator-first
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (async-iterator-first) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
async-iterator-first
Returns the first result from an async iterator
Mostly useful for tests.
Install
$ npm install --save async-iterator-first
Usage
const first = require('async-iterator-first')
async function * iterator (values) {
for (let i = 0; i < values.length; i++) {
yield values[i]
}
}
const res = await first(iterator([0, 1, 2, 3, 4]))
console.info(res) // 0