What a watchlist panel calls, and nothing more. WatchlistRepository implements it, with duplicateList besides; a host with its own server-side lists can implement it directly instead.

interface WatchlistStore {
    addEntry(
        id: string,
        entry: InstrumentKey,
        options?: WatchlistOperationOptions & { index?: number },
    ): Promise<Watchlist>;
    createList(
        name: string,
        entries?: readonly InstrumentKey[],
        options?: WatchlistOperationOptions,
    ): Promise<Watchlist>;
    load(): Promise<WatchlistCatalog>;
    moveEntry(
        id: string,
        entry: InstrumentKey,
        index: number,
        options?: WatchlistOperationOptions,
    ): Promise<Watchlist>;
    removeEntry(
        id: string,
        entry: InstrumentKey,
        options?: WatchlistOperationOptions,
    ): Promise<Watchlist>;
    removeList(id: string, options?: WatchlistOperationOptions): Promise<void>;
    renameList(
        id: string,
        name: string,
        options?: WatchlistOperationOptions,
    ): Promise<Watchlist>;
    setActiveList(
        id: null | string,
        options?: WatchlistOperationOptions,
    ): Promise<void>;
    subscribe(listener: (catalog: WatchlistCatalog) => void): () => void;
}

Implemented by

Methods

  • Called after each change this store commits, before that change's promise resolves, as WatchlistRepository does: the panel computes a following move from the catalog delivered here. Returns the unsubscribe.

    Parameters

    Returns () => void