MessageController: return all messages by sent at, not just 1

This commit is contained in:
Evan Hahn 2021-06-22 18:05:05 -05:00 committed by GitHub
parent baff13926b
commit 9db19283ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 128 additions and 16 deletions

View file

@ -90,6 +90,18 @@ class FilterIterator<T> implements Iterator<T> {
}
}
export function find<T>(
iterable: Iterable<T>,
predicate: (value: T) => unknown
): undefined | T {
for (const value of iterable) {
if (predicate(value)) {
return value;
}
}
return undefined;
}
export function groupBy<T>(
iterable: Iterable<T>,
fn: (value: T) => string