Skip to content

@jsvision/ui / historyAdd

Function: historyAdd() ​

historyAdd(id, str, maxEntries?): void

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

Append str as the most-recent entry for id (skip-empty / dedup / append / evict-oldest, per addEntry).

Parameters ​

id ​

number

The numeric history id.

str ​

string

The value to record.

maxEntries? ​

number

The per-id cap (default HISTORY_MAX_ENTRIES).

Returns ​

void

Example ​

ts
import { historyAdd, historyEntries } from '@jsvision/ui';
historyAdd(1, '/usr/bin');
historyAdd(1, '/etc/hosts');
historyEntries(1); // ['/usr/bin', '/etc/hosts'] (oldest → newest)