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

Function handleMoveIn

packages/db-ivm/src/operators/topKState.ts:90–98  ·  view source on GitHub ↗
(
  moveIn: IndexedValue<[K, T]> | null,
  result: Array<[[K, IndexedValue<T>], number]>,
)

Source from the content-addressed store, hash-verified

88 * Handles a moveIn change by adding it to the result array.
89 */
90export function handleMoveIn<K extends string | number, T>(
91 moveIn: IndexedValue<[K, T]> | null,
92 result: Array<[[K, IndexedValue<T>], number]>,
93): void {
94 if (moveIn) {
95 const [[key, value], index] = moveIn
96 result.push([[key, [value, index]], 1])
97 }
98}
99
100/**
101 * Handles a moveOut change by adding it to the result array.

Callers 4

#moveTopKMethod · 0.85
#processElementMethod · 0.85
moveTopKMethod · 0.85
processElementMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected