File tree Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,24 @@ export interface AdditionalOptions extends HookWatchOptions {
9
9
}
10
10
11
11
export interface DifferentialHookOptions < RowType > extends HookWatchOptions {
12
+ /**
13
+ * Used to detect and report differences in query result sets.
14
+ *
15
+ * By default the hook will requery on any dependent table change. This will
16
+ * emit a new hook result even if the result set has not changed.
17
+ *
18
+ * Specifying a {@link WatchedQueryDifferentiator} will remove emissions for
19
+ * unchanged result sets and preserve Array object references between result set emissions.
20
+ * @example
21
+ * ```javascript
22
+ * {
23
+ * differentiator: {
24
+ * identify: (item) => item.id,
25
+ * compareBy: (item) => JSON.stringify(item)
26
+ * }
27
+ * }
28
+ * ```
29
+ */
12
30
differentiator ?: WatchedQueryDifferentiator < RowType > ;
13
31
}
14
32
Original file line number Diff line number Diff line change @@ -10,6 +10,24 @@ import { usePowerSync } from './powerSync';
10
10
11
11
export interface AdditionalOptions < RowType = unknown > extends Omit < SQLOnChangeOptions , 'signal' > {
12
12
runQueryOnce ?: boolean ;
13
+ /**
14
+ * Used to detect and report differences in query result sets.
15
+ *
16
+ * By default the hook will requery on any dependent table change. This will
17
+ * emit a new hook result even if the result set has not changed.
18
+ *
19
+ * Specifying a {@link WatchedQueryDifferentiator} will remove emissions for
20
+ * unchanged result sets and preserve Array object references between result set emissions.
21
+ * @example
22
+ * ```javascript
23
+ * {
24
+ * differentiator: {
25
+ * identify: (item) => item.id,
26
+ * compareBy: (item) => JSON.stringify(item)
27
+ * }
28
+ * }
29
+ * ```
30
+ */
13
31
differentiator ?: WatchedQueryDifferentiator < RowType > ;
14
32
}
15
33
You can’t perform that action at this time.
0 commit comments