MCPcopy Create free account
hub / github.com/TanStack/db / constructor

Method constructor

packages/db/src/SortedMap.ts:19–23  ·  view source on GitHub ↗

* Creates a new SortedMap instance * * @param comparator - Optional function to compare values for sorting. * If not provided, entries are sorted by key only.

(comparator?: (a: TValue, b: TValue) => number)

Source from the content-addressed store, hash-verified

17 * If not provided, entries are sorted by key only.
18 */
19 constructor(comparator?: (a: TValue, b: TValue) => number) {
20 this.map = new Map<TKey, TValue>()
21 this.sortedKeys = []
22 this.comparator = comparator
23 }
24
25 /**
26 * Finds the index where a key-value pair should be inserted to maintain sort order.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected