Skip to main content
Deno 2 is finally here 🎉️
Learn more
Latest
function syncIterator
import { syncIterator } from "https://deno.land/x/natsws@v1.29.2/src/nats-base-client.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>