2021-04-13 10:57:08 +02:00
|
|
|
// Copyright: Ankitects Pty Ltd and contributors
|
|
|
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
|
|
|
2020-06-22 07:00:45 +02:00
|
|
|
export function assertUnreachable(x: never): never {
|
|
|
|
throw new Error(`unreachable: ${x}`);
|
|
|
|
}
|
2022-02-25 01:59:06 +01:00
|
|
|
|
|
|
|
export type Callback = () => void;
|
2022-03-02 05:21:19 +01:00
|
|
|
|
|
|
|
export function singleCallback(...callbacks: Callback[]): Callback {
|
|
|
|
return () => {
|
|
|
|
for (const cb of callbacks) {
|
|
|
|
cb();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|