Function unstable_createAsyncComputed

  • Experimental

    Creates an async computed signal in Alien Signals. The getter is an async generator that yields dependencies and finally resolves to a computed value.

    Type Parameters

    • T

      The type of the computed value.

    Parameters

    • getter: () => AsyncGenerator<Dependency, T>

      An async generator returning dependencies and ultimately a value.

    Returns AsyncComputed<T>

    The created async computed signal.

    const asyncComp = createAsyncComputed<number>(async function* () {
    yield someDependency;
    return 42;
    });