wip: components library

This commit is contained in:
Rie Takahashi
2022-10-24 18:04:25 +01:00
parent 5fac8be0ae
commit 0e7bd87cee
9 changed files with 200 additions and 17 deletions

View File

@ -180,6 +180,12 @@ export function waitFor(filter: string | string[] | FilterFn, callback: Callback
subscriptions.set(filter, callback);
}
export function proxyWaitFor(filter: string | string[] | FilterFn, mapper = m => m) {
let v;
waitFor(filter, m => v = mapper(m));
return proxyLazy(() => v);
}
export function addListener(callback: CallbackFn) {
listeners.add(callback);
}