Type alias State<T, U, V>

State<T, U, V>: {
    interval: number;
    payload: T | U | null;
    phase: Phase<V>;
    timestamp: number;
}

Definition of poll state at any given time.

Type Parameters

  • T
  • U
  • V extends string

Type declaration

  • Readonly interval: number

    The number of milliseconds until the current tick resolves.

  • Readonly payload: T | U | null

    The payload of the last poll resolution or rejection.

    Notes

    The payload is null unless the phase is 'reconnected, 'resolved', or 'rejected'. Its type is T for resolutions and U for rejections.

  • Readonly phase: Phase<V>

    The current poll phase.

  • Readonly timestamp: number

    The timestamp for when this tick was scheduled.

Typeparam

T - The resolved type of the factory's promises.

Typeparam

U - The rejected type of the factory's promises.

Typeparam

V - The type to extend the phases supported by a poll.