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

Method constructor

packages/db/src/collection/state.ts:131–140  ·  view source on GitHub ↗

* Creates a new CollectionState manager

(config: CollectionConfig<TOutput, TKey, TSchema>)

Source from the content-addressed store, hash-verified

129 * Creates a new CollectionState manager
130 */
131 constructor(config: CollectionConfig<TOutput, TKey, TSchema>) {
132 this.config = config
133 this.transactions = new SortedMap<string, Transaction<any>>((a, b) =>
134 a.compareCreatedAt(b),
135 )
136
137 // Set up data storage - always use SortedMap for deterministic iteration.
138 // If a custom compare function is provided, use it; otherwise entries are sorted by key only.
139 this.syncedData = new SortedMap<TKey, TOutput>(config.compare)
140 }
141
142 setDeps(deps: {
143 collection: CollectionImpl<TOutput, TKey, any, TSchema, TInput>

Callers

nothing calls this directly

Calls 1

compareCreatedAtMethod · 0.80

Tested by

no test coverage detected