mirror of
https://github.com/vector-im/element-call.git
synced 2026-09-16 22:09:30 +00:00
start onwMemberhsip.ts
This commit is contained in:
@@ -6,6 +6,7 @@ Please see LICENSE in the repository root for full details.
|
||||
*/
|
||||
|
||||
import { catchError, from, map, type Observable, of, startWith } from "rxjs";
|
||||
import { Behavior } from "./Behavior";
|
||||
|
||||
/**
|
||||
* Data that may need to be loaded asynchronously.
|
||||
@@ -51,3 +52,9 @@ export function mapAsync<A, B>(
|
||||
): Async<B> {
|
||||
return async.state === "ready" ? ready(project(async.value)) : async;
|
||||
}
|
||||
|
||||
export function unwrapAsync<A>(fallback: A): (async: Async<A>) => A {
|
||||
return (async: Async<A>) => {
|
||||
return async.state === "ready" ? async.value : fallback;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user