@rekurt/openkline - v0.2.0
    Preparing search index...

    Interface DataTransport

    Interface hosts implement to feed the chart with history + live updates. @rekurt/openkline-core ships PollingTransport and the abstract WebSocketTransport base as concrete starting points, but custom transports are trivially written — the interface has only four methods.

    Error handling: both fetchHistory and subscribe should throw (or reject in the async case) on failure; the chart's DataFeed forwards those errors through ChartConfig.onError with a structured ChartError payload.

    interface DataTransport {
        destroy(): void;
        fetchHistory(req: HistoryRequest): Promise<Candle[]>;
        subscribe(
            config: DataFeedConfig,
            onUpdate: (candles: Candle[]) => void,
        ): void;
        unsubscribe(): void;
    }

    Implemented by

    Index

    Methods

    • Release all resources (close socket, abort fetch, clear timers).

      Returns void

    • Stop a live stream started by subscribe.

      Returns void