Speaking indicator for group calls
Co-authored-by: Peter Thatcher <peter@signal.org> Co-authored-by: Jim Gustafson <jim@signal.org> Co-authored-by: Josh Perez <60019601+josh-signal@users.noreply.github.com>
This commit is contained in:
parent
cb5131420f
commit
5ce26eb91a
35 changed files with 482 additions and 42 deletions
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2021 Signal Messenger, LLC
|
||||
// Copyright 2021-2022 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
/* eslint-disable max-classes-per-file */
|
||||
|
@ -46,6 +46,18 @@ class ConcatIterable<T> implements Iterable<T> {
|
|||
}
|
||||
}
|
||||
|
||||
export function every<T>(
|
||||
iterable: Iterable<T>,
|
||||
predicate: (value: T) => boolean
|
||||
): boolean {
|
||||
for (const value of iterable) {
|
||||
if (!predicate(value)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
export function filter<T, S extends T>(
|
||||
iterable: Iterable<T>,
|
||||
predicate: (value: T) => value is S
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue