Async iterator over the events of a Subscribable or
AsyncSubscribable. Each value is the array of arguments of an
event.
The iterator subscribes on the first call to next() and unsubscribes when
return() is called. A for await ... of loop calls return() when the
loop exits. The iterator is also AsyncDisposable, so await using can
stop it:
await usingiterator = event.iterator(); const { value } = awaititerator.next();
Async iterator over the events of a Subscribable or AsyncSubscribable. Each value is the array of arguments of an event.
The iterator subscribes on the first call to
next()and unsubscribes whenreturn()is called. Afor await ... ofloop callsreturn()when the loop exits. The iterator is alsoAsyncDisposable, soawait usingcan stop it: