MCPcopy Index your code
hub / github.com/tensorflow/tfjs / next

Method next

tfjs-data/src/iterators/lazy_iterator.ts:544–551  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

542 }
543
544 async next(): Promise<IteratorResult<T>> {
545 // This sets this.lastRead to a new Promise right away, as opposed to
546 // saying `await this.lastRead; this.lastRead = this.serialNext();` which
547 // would not work because this.nextRead would be updated only after the
548 // promise resolves.
549 this.lastRead = this.lastRead.then(() => this.serialNext());
550 return this.lastRead;
551 }
552
553 private async serialNext(): Promise<IteratorResult<T>> {
554 return this.upstream.next();

Callers

nothing calls this directly

Calls 1

serialNextMethod · 0.95

Tested by

no test coverage detected