@daiso-tech/core
Version:
The library offers flexible, framework-agnostic solutions for modern web applications, built on adaptable components that integrate seamlessly with popular frameworks like Next Js.
25 lines • 727 B
JavaScript
/**
* @module Collection
*/
import {} from "../../../../collection/contracts/_module-exports.js";
import { resolveInvokable } from "../../../../utilities/_module-exports.js";
/**
* @internal
*/
export class AsyncTakeUntilIterable {
collection;
predicateFn;
constructor(collection, predicateFn) {
this.collection = collection;
this.predicateFn = predicateFn;
}
async *[Symbol.asyncIterator]() {
for await (const [index, item] of this.collection.entries()) {
if (await resolveInvokable(this.predicateFn)(item, index, this.collection)) {
break;
}
yield item;
}
}
}
//# sourceMappingURL=async-take-until-iterable.js.map