Interface IPoll<T, U, V>

A readonly poll that calls an asynchronous function with each tick.

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.

interface IPoll<T, U, V> {
    disposed: ISignal<IPoll<T, U, V>, void>;
    frequency: Frequency;
    isDisposed: boolean;
    name: string;
    state: State<T, U, V>;
    tick: Promise<IPoll<T, U, V>>;
    ticked: ISignal<IPoll<T, U, V>, State<T, U, V>>;
    [asyncIterator](): AsyncIterator<State<T, U, V>, any, undefined>;
}

Type Parameters

  • T
  • U
  • V extends string

Hierarchy

Implemented by

Properties

disposed: ISignal<IPoll<T, U, V>, void>

A signal emitted when the poll is disposed.

frequency: Frequency

The polling frequency data.

isDisposed: boolean

Whether the poll is disposed.

name: string

The name of the poll.

state: State<T, U, V>

The poll state, which is the content of the currently-scheduled poll tick.

tick: Promise<IPoll<T, U, V>>

A promise that resolves when the currently-scheduled tick completes.

Notes

Usually this will resolve after state.interval milliseconds from state.timestamp. It can resolve earlier if the user starts or refreshes the poll, etc.

ticked: ISignal<IPoll<T, U, V>, State<T, U, V>>

A signal emitted when the poll state changes, i.e., a new tick is scheduled.

Methods

  • Returns AsyncIterator<State<T, U, V>, any, undefined>