Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the stream async-iterable #26

Open
taleinat opened this issue Sep 27, 2019 · 0 comments
Open

Make the stream async-iterable #26

taleinat opened this issue Sep 27, 2019 · 0 comments

Comments

@taleinat
Copy link

Since node v10, ReadableStreams are async-iterable, i.e. one can do the following:

for await (const chunk of readable) {
    data += chunk;
}

See the docs for more details.

It would be very convenient to be able to iterate through changes this way:

const ChangesStream = require('changes-stream');

const changes = new ChangesStream({ db: '...' });
for await (const change of changes) {
  ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant