Skip to main content
Deno 2 is finally here 🎉️
Learn more
Go to Latest
function syncIterator
import { syncIterator } from "https://deno.land/x/natsws@v1.28.0/src/mod.ts";

syncIterator is a utility function that allows an AsyncIterator to be triggered by calling next() - the utility will yield null if the underlying iterator is closed. Note it is possibly an error to call use this function on an AsyncIterable that has already been started (Symbol.asyncIterator() has been called) from a looping construct.

Parameters

src: AsyncIterable<T>