Skip to content

@jsvision/ui / historyStr

Function: historyStr()

historyStr(id, index): string | undefined

Defined in: ui/src/dropdown/history-store.ts:73

The index-th entry for id (0 = oldest), or undefined if out of range (bounds-checked).

Parameters

id

number

The numeric history id.

index

number

The 0-based index (0 = oldest).

Returns

string | undefined

The entry text, or undefined.

Example

ts
import { historyAdd, historyStr } from '@jsvision/ui';
historyAdd(2, 'first');
historyAdd(2, 'second');
historyStr(2, 0); // 'first' (oldest)
historyStr(2, 9); // undefined (out of range)