RubenVerborgh / AsyncIterator

An asynchronous iterator library for advanced object pipelines in JavaScript
https://rubenverborgh.github.io/AsyncIterator/docs/
Other
48 stars 7 forks source link

Adds destroySource support to wrap() and WrappingIterator #85

Closed jacoscaz closed 2 years ago

jacoscaz commented 2 years ago

Closes #83

jacoscaz commented 2 years ago

@rubensworks I guess WrappingIterator implicitly behaves as if autoStart is always set to false. Perhaps we can make it so that if only autoStart: false is passed we can return a WrappingIterator instead of a TransformIterator?

rubensworks commented 2 years ago

I guess WrappingIterator implicitly behaves as if autoStart is always set to false

Not sure, at first glance it looks to me like source is immediately being set, and things like listeners are being attached. I suspect some more changes would have to be made, similar to TransformIterator.

jacoscaz commented 2 years ago

@rubensworks I think I've done it in https://github.com/RubenVerborgh/AsyncIterator/pull/85/commits/80fb650d7b06274ed80c61e0194a11a95b2621e7 but we can rollback if it doesn't look right.

jacoscaz commented 2 years ago

Mh... Nope, nevermind. I tested it with one project before pushing but it did break another. I'll rollback and consider this PR complete. We can address this separately.

jeswr commented 2 years ago

I'll rollback and consider this PR complete. We can address this separately.

bump @RubenVerborgh ?

RubenVerborgh commented 2 years ago

Thanks @jacoscaz, great work!