Options
All
  • Public
  • Public/Protected
  • All
Menu

Module saga

Index

References

Renames and re-exports SagaContext
Re-exports delay

Type Aliases

AnySignal<T>: Signal<T> | CustomSignal<T>

Type Parameters

  • T = void

AsyncResult<T>: { error: any; result: T }

Type Parameters

  • T

Type declaration

  • error: any
  • result: T
Awaitable<T>: { on: any }

Type Parameters

  • T

Type declaration

  • on:function
    • on(listener: ((value: T) => void)): VoidFunction
AwaitableMap: Record<string, Saga<any[], any> | Awaitable<any> | Promise<any>>
Cancellable: { cancel: any; cancelled: any }

Type declaration

ContinuousTask: Task & { once: any; times: any }
CreateSignal: { <T>(): Signal<T>; <T>(emitter: SignalEmitter<T>): CustomSignal<T> }

Type declaration

CustomSignal<T>: Awaitable<T> & { end: any; pause: any; payload: any; start: any; status: any }

Type Parameters

  • T

Emittable<T>: Awaitable<T> & { clear: any; emit: any }

Type Parameters

  • T = void

Listenable<T>: Atom<T> | AnySignal<T>

Type Parameters

  • T = void

ListenableList: Listenable<any> | Listenable<any>[]
Saga<A, R>: ((context: SagaContext, ...args: A) => R | Promise<R>)

Type Parameters

  • A extends any[] = any[]

  • R = any

Type declaration

    • Parameters

      Returns R | Promise<R>

SagaContext: Cancellable & { fork: ForkFn; abortController: any; all: any; allSettled: any; call: any; callback: any; debounce: any; delay: any; droppable: any; emit: any; infinite: any; listenable: any; on: any; onCancel: any; onDispose: any; onError: any; race: any; restartable: any; sequential: any; set: any; spawn: any; throttle: any; when: any }

Saga context

Signal<T>: Awaitable<T> & { payload: any }

Type Parameters

  • T = void

SignalEmitter<T>: ((emit: ((payload: T) => void), end: VoidFunction) => VoidFunction | void)

Type Parameters

  • T

Type declaration

    • (emit: ((payload: T) => void), end: VoidFunction): VoidFunction | void
    • Parameters

      • emit: ((payload: T) => void)
          • (payload: T): void
          • Parameters

            • payload: T

            Returns void

      • end: VoidFunction

      Returns VoidFunction | void

SignalStatus: "idle" | "active" | "pausing"
Task<T>: Cancellable & Awaitable<void> & { error: any; result: any; status: any }

Type Parameters

  • T = void

TaskStatus: "idle" | "running" | "error" | "success" | "cancelled"
WaitResult<T>: { [ key in keyof T]: T[key] extends Promise<infer V> ? AsyncResult<V> : T[key] extends Signal<infer V> ? AsyncResult<V> : T[key] extends Task<infer V> ? AsyncResult<V> : T[key] extends Saga<any[], infer V> ? AsyncResult<V> : never }

Type Parameters

  • T

Variables

forever: Promise<any> = ...

Functions

  • isAwaitable(value: any): value is Awaitable<any>
  • isEmittable<T>(value: any): value is Emittable<T>
  • isSignal<T>(value: any): value is Signal<T>
  • isTask<T>(value: any): value is Task<T>
  • spawn<A, R>(saga: Saga<A, R>, ...args: A): Task<R>

Generated using TypeDoc