* 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,
)
| 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 { |
no test coverage detected