Skip to content

Documentation / @finchart/react / InfiniteHistoryState

Interface: InfiniteHistoryState<T, C> ​

Defined in: react/src/hooks/use-infinite-history.ts:52

Type Parameters ​

T ​

T extends BaseDataPoint

C ​

C = never

Properties ​

data ​

readonly data: T[]

Defined in: react/src/hooks/use-infinite-history.ts:54

What is held — the last load, the pages landed before it, and your own edits. Pass it as the series' data.


readonly link: HistoryLink

Defined in: react/src/hooks/use-infinite-history.ts:80

What <InfiniteHistory> pages through (HistoryLink). A copy of the value carries it along.


load ​

readonly load: HistoryLoad | null

Defined in: react/src/hooks/use-infinite-history.ts:71

The load on screen — what reset returned for it; null before the first.


setData ​

readonly setData: (action, load?) => void

Defined in: react/src/hooks/use-infinite-history.ts:69

Edit what is held — a live bar, a snapshot merge. Pages keep landing on top of it. An edit is for one load's bars and is dropped if React applies it once another load holds them: load names it (what reset returned — a feed's first tick before the reset commits), and without it the edit is for the load on screen when it's made — so a tick for a symbol being left never lands on the next one's bars.

Parameters ​

action ​

SetStateAction<T[]>

load? ​

HistoryLoad

Returns ​

void


status ​

readonly status: HistoryStatus | null

Defined in: react/src/hooks/use-infinite-history.ts:60

The loader's state as React state: null while nothing pages (no load, a load without paging, no <InfiniteHistory> mounted), done or terminated once the load's history has ended — mounted or not.

Methods ​

reset() ​

reset(bars, paging): HistoryLoad

Defined in: react/src/hooks/use-infinite-history.ts:78

A new load — a symbol, an interval: holds bars and pages back with paging (null: nothing to page). A page still on its way for the load before is dropped. What it's handed is the caller's to vouch for: a first page that answers for a symbol already left must not reach it.

Parameters ​

bars ​

T[]

paging ​

HistoryPaging<T, C> | null

Returns ​

HistoryLoad