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.


    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.


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


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


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