MCPcopy
hub / github.com/tensorflow/tfjs / resolveWhile

Function resolveWhile

tfjs-data/src/iterators/lazy_iterator.ts:226–233  ·  view source on GitHub ↗

* Draw items from the stream until it is exhausted, or a predicate fails. * * This can be useful when the stream has side effects but no output. In * that case, calling this function guarantees that the stream will be * fully processed.

(predicate: (r: T) => boolean)

Source from the content-addressed store, hash-verified

224 * fully processed.
225 */
226 async resolveWhile(predicate: (r: T) => boolean): Promise<void> {
227 let x = await this.next();
228 let shouldContinue = predicate(x.value);
229 while ((!x.done) && shouldContinue) {
230 x = await this.next();
231 shouldContinue = predicate(x.value);
232 }
233 }
234
235 /**
236 * Handles errors thrown on this stream using a provided handler function.

Callers

nothing calls this directly

Calls 1

nextMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…