Function unstable_createAsyncEffect

  • Creates an async effect in Alien Signals. The function is an async generator that yields dependencies as they are discovered.

    Type Parameters

    • T

      The type of the effect value.

    Parameters

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

      An async generator returning dependencies.

    Returns Promise<T>

    The created async effect object.

    createAsyncEffect(async function* () {
    yield someDependency;
    console.log('Async effect done!');
    });