By default, reads all the values from source, or until 5 seconds has elapsed.
source
If limit is provided as an option, it will exit early, or throw if that number of values was not acheived.
limit
// Read from `source` for 5 secondsconst data = await toArrayOrThrow()(source);// Read 5 items from `source`const data = await toArrayOrThrow({ limit: 5 })(source);// Read for 10sconst data = await toArrayOrThrow({ maximumWait: 10_1000 })(source); Copy
// Read from `source` for 5 secondsconst data = await toArrayOrThrow()(source);// Read 5 items from `source`const data = await toArrayOrThrow({ limit: 5 })(source);// Read for 10sconst data = await toArrayOrThrow({ maximumWait: 10_1000 })(source);
By default, reads all the values from
source
, or until 5 seconds has elapsed.If
limit
is provided as an option, it will exit early, or throw if that number of values was not acheived.