MCPcopy Index your code
hub / github.com/TanStack/db / trackSentValues

Method trackSentValues

packages/db/src/query/effect.ts:940–956  ·  view source on GitHub ↗

* Track the biggest value sent for a given ordered alias. * Used for cursor-based pagination in loadNextItems.

(
    alias: string,
    changes: Array<ChangeMessage<any, string | number>>,
    comparator: (a: any, b: any) => number,
  )

Source from the content-addressed store, hash-verified

938 * Used for cursor-based pagination in loadNextItems.
939 */
940 private trackSentValues(
941 alias: string,
942 changes: Array<ChangeMessage<any, string | number>>,
943 comparator: (a: any, b: any) => number,
944 ): void {
945 const sentKeys = this.sentToD2KeysByAlias.get(alias) ?? new Set()
946 const result = trackBiggestSentValue(
947 changes,
948 this.biggestSentValue.get(alias),
949 sentKeys,
950 comparator,
951 )
952 this.biggestSentValue.set(alias, result.biggest)
953 if (result.shouldResetLoadKey) {
954 this.lastLoadRequestKey.delete(alias)
955 }
956 }
957
958 /** Tear down subscriptions and clear state */
959 dispose(): void {

Callers 1

startMethod · 0.95

Calls 4

trackBiggestSentValueFunction · 0.85
getMethod · 0.45
setMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected