The iterator created by this method gives users the option to cancel the destruction
of the stream if the for await...of loop is exited by return, break, or throw,
or if the iterator should destroy the stream if the stream emitted an error during iteration.
Parameters
Optionaloptions: {destroyOnReturn?:boolean}
OptionaldestroyOnReturn?: boolean
When set to false, calling return on the async iterator,
or exiting a for await...of iteration using a break, return, or throw will not destroy the stream.
Default: true.
The iterator created by this method gives users the option to cancel the destruction of the stream if the
for await...of
loop is exited byreturn
,break
, orthrow
, or if the iterator should destroy the stream if the stream emitted an error during iteration.