mini-effect
    Preparing search index...

    Type Alias Thunk<R>

    Thunk: (signal: AbortSignal, ctx: Record<string, unknown>) => R | PromiseLike<R>

    A function that performs the actual work of an Effect.

    Type Parameters

    • out R

      The success value type produced by the thunk

    Type Declaration

      • (signal: AbortSignal, ctx: Record<string, unknown>): R | PromiseLike<R>
      • Parameters

        • signal: AbortSignal

          An AbortSignal that is triggered when the effect is cancelled

        • ctx: Record<string, unknown>

          An internal record used to propagate Dependency values

        Returns R | PromiseLike<R>

        The result value R, or a PromiseLike<R> for async work

    A Thunk receives an AbortSignal for cancellation and an internal context record used for dependency injection. It may return its result synchronously or as a PromiseLike for asynchronous work.

    Thunks are passed to fn to create lazy effects.