Interface Subject

A subject is observed by a watch.

interface Subject {
    display: string;
    pollRate: number;
    add(ids: string[]): Promise<void>;
    get(id: string | HRef): undefined | HDict;
    inspect(): void;
    off(callback: SubjectChangedEventHandler): void;
    on(callback: SubjectChangedEventHandler): void;
    poll(): Promise<void>;
    refresh(): Promise<void>;
    remove(ids: string[]): Promise<void>;
    update(grid: HGrid): Promise<void>;
}

Properties

display: string

The display name of the subject.

pollRate: number

The subject's poll rate.

Methods

  • Add records to observe.

    Parameters

    • ids: string[]

      The ids to add.

    Returns Promise<void>

  • Return a record via its id or undefined if it can't be found.

    Parameters

    • id: string | HRef

      The id to record to get.

    Returns undefined | HDict

    The dict or undefined if it can't be found.

  • Remove records from the subject.

    This is called to stop observing records.

    Parameters

    • ids: string[]

      The ids to remove.

    Returns Promise<void>

  • Used to manually trigger a watch update.

    Parameters

    • grid: HGrid

      A grid of dicts to update.

    Returns Promise<void>