This package has been deprecated

Author message:

Use TransformIterator in asynciterator v3 with autoStart: false

asynciterator-promiseproxy
TypeScript icon, indicating that this package has built-in type declarations

2.1.0 • Public • Published

Async Promise Proxy Iterator

Build Status Coverage Status npm version Greenkeeper badge

An AsyncIterator proxy that allows its source to be set via a promise.

This is useful in cases when you need to pass an iterator, but only know its source at a later stage, or if you want to create this source lazilly.

Usage

const PromiseProxyIterator = require('asynciterator-promiseproxy').PromiseProxyIterator;
 
let it = new PromiseProxyIterator(() -> makeIterator());
it.on('data', console.log);
 
async function makeIterator() {
  someExpensiveOperation();
  return AsyncIterator.range(0, 10); 
}

License

This software is written by Ruben Taelman.

This code is released under the MIT license.

Package Sidebar

Install

npm i asynciterator-promiseproxy

Weekly Downloads

15

Version

2.1.0

License

MIT

Unpacked Size

6.28 kB

Total Files

7

Last publish

Collaborators

  • rubensworks