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

Function handleMoveOut

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

Source from the content-addressed store, hash-verified

101 * Handles a moveOut change by adding it to the result array.
102 */
103export function handleMoveOut<K extends string | number, T>(
104 moveOut: IndexedValue<[K, T]> | null,
105 result: Array<[[K, IndexedValue<T>], number]>,
106): void {
107 if (moveOut) {
108 const [[key, value], index] = moveOut
109 result.push([[key, [value, index]], -1])
110 }
111}

Callers 4

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

Calls

no outgoing calls

Tested by

no test coverage detected