Consecutive playback and per-conversation playback rate
This commit is contained in:
parent
eb10aafd7c
commit
6cfe2a09df
20 changed files with 783 additions and 319 deletions
|
@ -112,6 +112,16 @@ export function collect<T, S>(
|
|||
return new CollectIterable(iterable, fn);
|
||||
}
|
||||
|
||||
export function collectFirst<T, S>(
|
||||
iterable: Iterable<T>,
|
||||
fn: (value: T) => S | undefined
|
||||
): S | undefined {
|
||||
for (const v of collect(iterable, fn)) {
|
||||
return v;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
class CollectIterable<T, S> implements Iterable<S> {
|
||||
constructor(
|
||||
private readonly iterable: Iterable<T>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue