tinybase 8.1.0-beta.3 → 8.1.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,7 @@
1
1
  import {getContext, setContext, untrack} from 'svelte';
2
2
  import * as $ from 'svelte/internal/client';
3
3
  import 'svelte/internal/disclose-version';
4
+ import {createSubscriber} from 'svelte/reactivity';
4
5
 
5
6
  const getTypeOf = (thing) => typeof thing;
6
7
  const TINYBASE = 'tinybase';
@@ -44,10 +45,13 @@ const getIfNotFunction = (predicate) => (value, then, otherwise) =>
44
45
  ? /* istanbul ignore next */
45
46
  otherwise?.()
46
47
  : then(value);
48
+ const GLOBAL = globalThis;
47
49
  const isUndefined = (thing) => thing === void 0;
50
+ const hasWindow = () => !isUndefined(GLOBAL.window);
48
51
  const ifNotUndefined = getIfNotFunction(isUndefined);
49
52
  const isString = (thing) => getTypeOf(thing) == STRING;
50
53
  const isFunction = (thing) => getTypeOf(thing) == FUNCTION;
54
+ const noop = () => {};
51
55
 
52
56
  const object = Object;
53
57
  const objIds = object.keys;
@@ -55,7 +59,40 @@ const objGet = (obj, id) => ifNotUndefined(obj, (obj2) => obj2[id]);
55
59
 
56
60
  const TINYBASE_CONTEXT_KEY = TINYBASE + '_uisc';
57
61
 
58
- /* hooks.svelte.ts generated by Svelte v5.54.0 */
62
+ /* functions.svelte.ts generated by Svelte v5.55.1 */
63
+
64
+ class ReactiveHandle {
65
+ #get;
66
+ #sub;
67
+
68
+ constructor(getCurrent, subscribe) {
69
+ this.#get = getCurrent;
70
+ this.#sub = subscribe;
71
+ }
72
+
73
+ get current() {
74
+ this.#sub();
75
+
76
+ return this.#get();
77
+ }
78
+ }
79
+
80
+ class WritableHandle extends ReactiveHandle {
81
+ #set;
82
+
83
+ constructor(getCurrent, setCurrent, subscribe) {
84
+ super(getCurrent, subscribe);
85
+ this.#set = setCurrent;
86
+ }
87
+
88
+ get current() {
89
+ return super.current;
90
+ }
91
+
92
+ set current(value) {
93
+ this.#set(value);
94
+ }
95
+ }
59
96
 
60
97
  const EMPTY_ARR = [];
61
98
  const EMPTY_OBJ = {};
@@ -78,10 +115,10 @@ const getThing = (contextValue, thingOrThingId, offset) =>
78
115
  ? objGet(contextValue[offset * 2 + 1], thingOrThingId)
79
116
  : thingOrThingId;
80
117
 
81
- const useThing = (thingOrThingId, offset) =>
118
+ const getProvidedThing = (thingOrThingId, offset) =>
82
119
  getThing(getContextValue(), thingOrThingId, offset);
83
120
 
84
- const useThingOrThingById = (thingOrThingId, offset) => {
121
+ const resolveProvidedThing = (thingOrThingId, offset) => {
85
122
  const contextValue = getContextValue();
86
123
 
87
124
  return () => getThing(contextValue, maybeGet(thingOrThingId), offset);
@@ -90,66 +127,65 @@ const useThingOrThingById = (thingOrThingId, offset) => {
90
127
  const getThingIds = (contextValue, offset) =>
91
128
  objIds(contextValue[offset * 2 + 1] ?? EMPTY_OBJ);
92
129
 
93
- const useStoreOrStoreById = (storeOrStoreId) =>
94
- useThingOrThingById(storeOrStoreId, OFFSET_STORE);
95
- const useMetricsOrMetricsById = (metricsOrMetricsId) =>
96
- useThingOrThingById(metricsOrMetricsId, OFFSET_METRICS);
97
- const useIndexesOrIndexesById = (indexesOrIndexesId) =>
98
- useThingOrThingById(indexesOrIndexesId, OFFSET_INDEXES);
99
- const useRelationshipsOrRelationshipsById = (relationshipsOrRelationshipsId) =>
100
- useThingOrThingById(relationshipsOrRelationshipsId, OFFSET_RELATIONSHIPS);
101
- const useQueriesOrQueriesById = (queriesOrQueriesId) =>
102
- useThingOrThingById(queriesOrQueriesId, OFFSET_QUERIES);
103
- const useCheckpointsOrCheckpointsById = (checkpointsOrCheckpointsId) =>
104
- useThingOrThingById(checkpointsOrCheckpointsId, OFFSET_CHECKPOINTS);
105
- const usePersisterOrPersisterById = (persisterOrPersisterId) =>
106
- useThingOrThingById(persisterOrPersisterId, OFFSET_PERSISTER);
107
- const useSynchronizerOrSynchronizerById = (synchronizerOrSynchronizerId) =>
108
- useThingOrThingById(synchronizerOrSynchronizerId, OFFSET_SYNCHRONIZER);
109
-
110
- const useListenable = (
130
+ const resolveStore = (storeOrStoreId) =>
131
+ resolveProvidedThing(storeOrStoreId, OFFSET_STORE);
132
+ const resolveMetrics = (metricsOrMetricsId) =>
133
+ resolveProvidedThing(metricsOrMetricsId, OFFSET_METRICS);
134
+ const resolveIndexes = (indexesOrIndexesId) =>
135
+ resolveProvidedThing(indexesOrIndexesId, OFFSET_INDEXES);
136
+ const resolveRelationships = (relationshipsOrRelationshipsId) =>
137
+ resolveProvidedThing(relationshipsOrRelationshipsId, OFFSET_RELATIONSHIPS);
138
+ const resolveQueries = (queriesOrQueriesId) =>
139
+ resolveProvidedThing(queriesOrQueriesId, OFFSET_QUERIES);
140
+ const resolveCheckpoints = (checkpointsOrCheckpointsId) =>
141
+ resolveProvidedThing(checkpointsOrCheckpointsId, OFFSET_CHECKPOINTS);
142
+ const resolvePersister = (persisterOrPersisterId) =>
143
+ resolveProvidedThing(persisterOrPersisterId, OFFSET_PERSISTER);
144
+ const resolveSynchronizer = (synchronizerOrSynchronizerId) =>
145
+ resolveProvidedThing(synchronizerOrSynchronizerId, OFFSET_SYNCHRONIZER);
146
+
147
+ const createListenable = (
111
148
  getThing2,
112
149
  listenable,
113
150
  defaultValue,
114
151
  getArgs = () => EMPTY_ARR,
115
152
  isHas,
116
153
  ) => {
117
- const getMethod = (isHas ? _HAS : GET) + listenable;
118
- const addMethod = ADD + (isHas ? HAS : '') + listenable + LISTENER;
119
- let value = $.state(
120
- $.proxy(getThing2()?.[getMethod]?.(...getArgs()) ?? defaultValue),
121
- );
154
+ const getListenableMethod = (isHas ? _HAS : GET) + listenable;
155
+ const addListenableMethod = ADD + (isHas ? HAS : '') + listenable + LISTENER;
156
+ let subscribe = $.state($.proxy(noop));
122
157
 
123
- if (typeof window !== 'undefined') {
158
+ if (hasWindow()) {
124
159
  $.user_effect(() => {
125
160
  const thing = getThing2();
126
161
  const args = getArgs();
127
162
 
128
- $.set(value, thing?.[getMethod]?.(...args) ?? defaultValue, true);
129
-
130
- const listenerId = thing?.[addMethod]?.(...args, () => {
131
- $.set(value, thing[getMethod](...getArgs()) ?? defaultValue, true);
132
- });
163
+ $.set(
164
+ subscribe,
165
+ createSubscriber((update) => {
166
+ const listenerId = thing?.[addListenableMethod]?.(...args, update);
133
167
 
134
- return () => thing?.delListener?.(listenerId);
168
+ return () => thing?.delListener?.(listenerId);
169
+ }),
170
+ true,
171
+ );
135
172
  });
136
173
  }
137
174
 
138
- return {
139
- get current() {
140
- return $.get(value);
141
- },
142
- };
175
+ return new ReactiveHandle(
176
+ () => getThing2()?.[getListenableMethod]?.(...getArgs()) ?? defaultValue,
177
+ () => $.get(subscribe)(),
178
+ );
143
179
  };
144
180
 
145
- const useListener = (
181
+ const addListenerEffect = (
146
182
  getThing2,
147
183
  listenable,
148
184
  listener,
149
185
  getPreArgs = () => EMPTY_ARR,
150
186
  mutator,
151
187
  ) => {
152
- if (typeof window !== 'undefined') {
188
+ if (hasWindow()) {
153
189
  $.user_effect(() => {
154
190
  const thing = getThing2();
155
191
  const preArgs = getPreArgs();
@@ -164,55 +200,55 @@ const useListener = (
164
200
  }
165
201
  };
166
202
 
167
- const useHasTables = (storeOrStoreId) =>
168
- useListenable(
169
- useStoreOrStoreById(storeOrStoreId),
203
+ const createHasTables = (storeOrStoreId) =>
204
+ createListenable(
205
+ resolveStore(storeOrStoreId),
170
206
  TABLES,
171
207
  false,
172
208
  () => EMPTY_ARR,
173
209
  1,
174
210
  );
175
- const useTables = (storeOrStoreId) =>
176
- useListenable(useStoreOrStoreById(storeOrStoreId), TABLES, EMPTY_OBJ);
177
- const useTableIds = (storeOrStoreId) =>
178
- useListenable(useStoreOrStoreById(storeOrStoreId), TABLE_IDS, EMPTY_ARR);
179
- const useHasTable = (tableId, storeOrStoreId) =>
180
- useListenable(
181
- useStoreOrStoreById(storeOrStoreId),
211
+ const createTables = (storeOrStoreId) =>
212
+ createListenable(resolveStore(storeOrStoreId), TABLES, EMPTY_OBJ);
213
+ const createTableIds = (storeOrStoreId) =>
214
+ createListenable(resolveStore(storeOrStoreId), TABLE_IDS, EMPTY_ARR);
215
+ const createHasTable = (tableId, storeOrStoreId) =>
216
+ createListenable(
217
+ resolveStore(storeOrStoreId),
182
218
  TABLE,
183
219
  false,
184
220
  () => [maybeGet(tableId)],
185
221
  1,
186
222
  );
187
- const useTable = (tableId, storeOrStoreId) =>
188
- useListenable(useStoreOrStoreById(storeOrStoreId), TABLE, EMPTY_OBJ, () => [
223
+ const createTable = (tableId, storeOrStoreId) =>
224
+ createListenable(resolveStore(storeOrStoreId), TABLE, EMPTY_OBJ, () => [
189
225
  maybeGet(tableId),
190
226
  ]);
191
- const useTableCellIds = (tableId, storeOrStoreId) =>
192
- useListenable(
193
- useStoreOrStoreById(storeOrStoreId),
227
+ const createTableCellIds = (tableId, storeOrStoreId) =>
228
+ createListenable(
229
+ resolveStore(storeOrStoreId),
194
230
  TABLE + CELL_IDS,
195
231
  EMPTY_ARR,
196
232
  () => [maybeGet(tableId)],
197
233
  );
198
- const useHasTableCell = (tableId, cellId, storeOrStoreId) =>
199
- useListenable(
200
- useStoreOrStoreById(storeOrStoreId),
234
+ const createHasTableCell = (tableId, cellId, storeOrStoreId) =>
235
+ createListenable(
236
+ resolveStore(storeOrStoreId),
201
237
  TABLE + CELL,
202
238
  false,
203
239
  () => [maybeGet(tableId), maybeGet(cellId)],
204
240
  1,
205
241
  );
206
- const useRowCount = (tableId, storeOrStoreId) =>
207
- useListenable(useStoreOrStoreById(storeOrStoreId), ROW_COUNT, 0, () => [
242
+ const createRowCount = (tableId, storeOrStoreId) =>
243
+ createListenable(resolveStore(storeOrStoreId), ROW_COUNT, 0, () => [
208
244
  maybeGet(tableId),
209
245
  ]);
210
- const useRowIds = (tableId, storeOrStoreId) =>
211
- useListenable(useStoreOrStoreById(storeOrStoreId), ROW_IDS, EMPTY_ARR, () => [
246
+ const createRowIds = (tableId, storeOrStoreId) =>
247
+ createListenable(resolveStore(storeOrStoreId), ROW_IDS, EMPTY_ARR, () => [
212
248
  maybeGet(tableId),
213
249
  ]);
214
250
 
215
- const useSortedRowIds = (
251
+ const createSortedRowIds = (
216
252
  tableId,
217
253
  cellId,
218
254
  descending = false,
@@ -220,8 +256,8 @@ const useSortedRowIds = (
220
256
  limit,
221
257
  storeOrStoreId,
222
258
  ) =>
223
- useListenable(
224
- useStoreOrStoreById(storeOrStoreId),
259
+ createListenable(
260
+ resolveStore(storeOrStoreId),
225
261
  SORTED_ROW_IDS,
226
262
  EMPTY_ARR,
227
263
  () => [
@@ -233,144 +269,135 @@ const useSortedRowIds = (
233
269
  ],
234
270
  );
235
271
 
236
- const useHasRow = (tableId, rowId, storeOrStoreId) =>
237
- useListenable(
238
- useStoreOrStoreById(storeOrStoreId),
272
+ const createHasRow = (tableId, rowId, storeOrStoreId) =>
273
+ createListenable(
274
+ resolveStore(storeOrStoreId),
239
275
  ROW,
240
276
  false,
241
277
  () => [maybeGet(tableId), maybeGet(rowId)],
242
278
  1,
243
279
  );
244
- const useRow = (tableId, rowId, storeOrStoreId) =>
245
- useListenable(useStoreOrStoreById(storeOrStoreId), ROW, EMPTY_OBJ, () => [
280
+ const createRow = (tableId, rowId, storeOrStoreId) =>
281
+ createListenable(resolveStore(storeOrStoreId), ROW, EMPTY_OBJ, () => [
246
282
  maybeGet(tableId),
247
283
  maybeGet(rowId),
248
284
  ]);
249
- const useCellIds = (tableId, rowId, storeOrStoreId) =>
250
- useListenable(
251
- useStoreOrStoreById(storeOrStoreId),
252
- CELL_IDS,
253
- EMPTY_ARR,
254
- () => [maybeGet(tableId), maybeGet(rowId)],
255
- );
256
- const useHasCell = (tableId, rowId, cellId, storeOrStoreId) =>
257
- useListenable(
258
- useStoreOrStoreById(storeOrStoreId),
285
+ const createCellIds = (tableId, rowId, storeOrStoreId) =>
286
+ createListenable(resolveStore(storeOrStoreId), CELL_IDS, EMPTY_ARR, () => [
287
+ maybeGet(tableId),
288
+ maybeGet(rowId),
289
+ ]);
290
+ const createHasCell = (tableId, rowId, cellId, storeOrStoreId) =>
291
+ createListenable(
292
+ resolveStore(storeOrStoreId),
259
293
  CELL,
260
294
  false,
261
295
  () => [maybeGet(tableId), maybeGet(rowId), maybeGet(cellId)],
262
296
  1,
263
297
  );
264
- const useCell = (tableId, rowId, cellId, storeOrStoreId) =>
265
- useListenable(useStoreOrStoreById(storeOrStoreId), CELL, void 0, () => [
266
- maybeGet(tableId),
267
- maybeGet(rowId),
268
- maybeGet(cellId),
269
- ]);
270
298
 
271
- const useBindableCell = (tableId, rowId, cellId, storeOrStoreId) => {
272
- const getS = useStoreOrStoreById(storeOrStoreId);
273
- let value = $.state(
274
- $.proxy(
275
- getS()?.getCell(maybeGet(tableId), maybeGet(rowId), maybeGet(cellId)),
276
- ),
277
- );
299
+ const createCell = (tableId, rowId, cellId, storeOrStoreId) => {
300
+ const getStore2 = resolveStore(storeOrStoreId);
301
+ let subscribe = $.state($.proxy(noop));
278
302
 
279
- if (typeof window !== 'undefined') {
303
+ if (hasWindow()) {
280
304
  $.user_effect(() => {
281
- const s = getS();
282
-
283
- const t = maybeGet(tableId),
284
- r = maybeGet(rowId),
285
- c = maybeGet(cellId);
286
-
287
- $.set(value, s?.getCell(t, r, c), true);
288
-
289
- const listenerId = s?.addCellListener(t, r, c, (st) => {
290
- $.set(
291
- value,
292
- st.getCell(maybeGet(tableId), maybeGet(rowId), maybeGet(cellId)),
293
- true,
294
- );
295
- });
305
+ const store = getStore2();
306
+ const tableIdValue = maybeGet(tableId);
307
+ const rowIdValue = maybeGet(rowId);
308
+ const cellIdValue = maybeGet(cellId);
309
+
310
+ $.set(
311
+ subscribe,
312
+ createSubscriber((update) => {
313
+ const listenerId = store?.addCellListener(
314
+ tableIdValue,
315
+ rowIdValue,
316
+ cellIdValue,
317
+ update,
318
+ );
296
319
 
297
- return () => s?.delListener?.(listenerId);
320
+ return () => store?.delListener?.(listenerId);
321
+ }),
322
+ true,
323
+ );
298
324
  });
299
325
  }
300
326
 
301
- return {
302
- get current() {
303
- return $.get(value);
304
- },
305
-
306
- set current(v) {
307
- getS()?.setCell(maybeGet(tableId), maybeGet(rowId), maybeGet(cellId), v);
308
- },
309
- };
327
+ return new WritableHandle(
328
+ () =>
329
+ getStore2()?.getCell(
330
+ maybeGet(tableId),
331
+ maybeGet(rowId),
332
+ maybeGet(cellId),
333
+ ),
334
+ (nextCell) =>
335
+ getStore2()?.setCell(
336
+ maybeGet(tableId),
337
+ maybeGet(rowId),
338
+ maybeGet(cellId),
339
+ nextCell,
340
+ ),
341
+ () => $.get(subscribe)(),
342
+ );
310
343
  };
311
344
 
312
- const useHasValues = (storeOrStoreId) =>
313
- useListenable(
314
- useStoreOrStoreById(storeOrStoreId),
345
+ const createHasValues = (storeOrStoreId) =>
346
+ createListenable(
347
+ resolveStore(storeOrStoreId),
315
348
  VALUES,
316
349
  false,
317
350
  () => EMPTY_ARR,
318
351
  1,
319
352
  );
320
- const useValues = (storeOrStoreId) =>
321
- useListenable(useStoreOrStoreById(storeOrStoreId), VALUES, EMPTY_OBJ);
322
- const useValueIds = (storeOrStoreId) =>
323
- useListenable(useStoreOrStoreById(storeOrStoreId), VALUE_IDS, EMPTY_ARR);
324
- const useHasValue = (valueId, storeOrStoreId) =>
325
- useListenable(
326
- useStoreOrStoreById(storeOrStoreId),
353
+ const createValues = (storeOrStoreId) =>
354
+ createListenable(resolveStore(storeOrStoreId), VALUES, EMPTY_OBJ);
355
+ const createValueIds = (storeOrStoreId) =>
356
+ createListenable(resolveStore(storeOrStoreId), VALUE_IDS, EMPTY_ARR);
357
+ const createHasValue = (valueId, storeOrStoreId) =>
358
+ createListenable(
359
+ resolveStore(storeOrStoreId),
327
360
  VALUE,
328
361
  false,
329
362
  () => [maybeGet(valueId)],
330
363
  1,
331
364
  );
332
- const useValue = (valueId, storeOrStoreId) =>
333
- useListenable(useStoreOrStoreById(storeOrStoreId), VALUE, void 0, () => [
334
- maybeGet(valueId),
335
- ]);
336
365
 
337
- const useBindableValue = (valueId, storeOrStoreId) => {
338
- const getS = useStoreOrStoreById(storeOrStoreId);
339
- let value = $.state($.proxy(getS()?.getValue(maybeGet(valueId))));
366
+ const createValue = (valueId, storeOrStoreId) => {
367
+ const getStore2 = resolveStore(storeOrStoreId);
368
+ let subscribe = $.state($.proxy(noop));
340
369
 
341
- if (typeof window !== 'undefined') {
370
+ if (hasWindow()) {
342
371
  $.user_effect(() => {
343
- const s = getS();
344
- const vid = maybeGet(valueId);
345
-
346
- $.set(value, s?.getValue(vid), true);
372
+ const store = getStore2();
373
+ const valueIdValue = maybeGet(valueId);
347
374
 
348
- const listenerId = s?.addValueListener(vid, (st) => {
349
- $.set(value, st.getValue(maybeGet(valueId)), true);
350
- });
375
+ $.set(
376
+ subscribe,
377
+ createSubscriber((update) => {
378
+ const listenerId = store?.addValueListener(valueIdValue, update);
351
379
 
352
- return () => s?.delListener?.(listenerId);
380
+ return () => store?.delListener?.(listenerId);
381
+ }),
382
+ true,
383
+ );
353
384
  });
354
385
  }
355
386
 
356
- return {
357
- get current() {
358
- return $.get(value);
359
- },
360
-
361
- set current(v) {
362
- getS()?.setValue(maybeGet(valueId), v);
363
- },
364
- };
387
+ return new WritableHandle(
388
+ () => getStore2()?.getValue(maybeGet(valueId)),
389
+ (nextValue) => getStore2()?.setValue(maybeGet(valueId), nextValue),
390
+ () => $.get(subscribe)(),
391
+ );
365
392
  };
366
393
 
367
- const useStore = (id) => useThing(id, OFFSET_STORE);
394
+ const getStore = (id) => getProvidedThing(id, OFFSET_STORE);
368
395
 
369
- const useStoreIds = () => {
396
+ const createStoreIds = () => {
370
397
  const contextValue = getContextValue();
371
398
  let ids = $.state($.proxy(getThingIds(contextValue, OFFSET_STORE)));
372
399
 
373
- if (typeof window !== 'undefined') {
400
+ if (hasWindow()) {
374
401
  $.user_effect(() => {
375
402
  $.set(ids, getThingIds(contextValue, OFFSET_STORE), true);
376
403
  });
@@ -383,13 +410,13 @@ const useStoreIds = () => {
383
410
  };
384
411
  };
385
412
 
386
- const useMetrics = (id) => useThing(id, OFFSET_METRICS);
413
+ const getMetrics = (id) => getProvidedThing(id, OFFSET_METRICS);
387
414
 
388
- const useMetricsIds = () => {
415
+ const createMetricsIds = () => {
389
416
  const contextValue = getContextValue();
390
417
  let ids = $.state($.proxy(getThingIds(contextValue, OFFSET_METRICS)));
391
418
 
392
- if (typeof window !== 'undefined') {
419
+ if (hasWindow()) {
393
420
  $.user_effect(() => {
394
421
  $.set(ids, getThingIds(contextValue, OFFSET_METRICS), true);
395
422
  });
@@ -402,26 +429,19 @@ const useMetricsIds = () => {
402
429
  };
403
430
  };
404
431
 
405
- const useMetricIds = (metricsOrMetricsId) =>
406
- useListenable(
407
- useMetricsOrMetricsById(metricsOrMetricsId),
408
- METRIC + IDS,
409
- EMPTY_ARR,
410
- );
411
- const useMetric = (metricId, metricsOrMetricsId) =>
412
- useListenable(
413
- useMetricsOrMetricsById(metricsOrMetricsId),
414
- METRIC,
415
- void 0,
416
- () => [maybeGet(metricId)],
417
- );
418
- const useIndexes = (id) => useThing(id, OFFSET_INDEXES);
432
+ const createMetricIds = (metricsOrMetricsId) =>
433
+ createListenable(resolveMetrics(metricsOrMetricsId), METRIC + IDS, EMPTY_ARR);
434
+ const createMetric = (metricId, metricsOrMetricsId) =>
435
+ createListenable(resolveMetrics(metricsOrMetricsId), METRIC, void 0, () => [
436
+ maybeGet(metricId),
437
+ ]);
438
+ const getIndexes = (id) => getProvidedThing(id, OFFSET_INDEXES);
419
439
 
420
- const useIndexesIds = () => {
440
+ const createIndexesIds = () => {
421
441
  const contextValue = getContextValue();
422
442
  let ids = $.state($.proxy(getThingIds(contextValue, OFFSET_INDEXES)));
423
443
 
424
- if (typeof window !== 'undefined') {
444
+ if (hasWindow()) {
425
445
  $.user_effect(() => {
426
446
  $.set(ids, getThingIds(contextValue, OFFSET_INDEXES), true);
427
447
  });
@@ -434,48 +454,44 @@ const useIndexesIds = () => {
434
454
  };
435
455
  };
436
456
 
437
- const useIndexIds = (indexesOrIndexesId) =>
438
- useListenable(
439
- useIndexesOrIndexesById(indexesOrIndexesId),
440
- INDEX + IDS,
441
- EMPTY_ARR,
442
- );
443
- const useSliceIds = (indexId, indexesOrIndexesId) =>
444
- useListenable(
445
- useIndexesOrIndexesById(indexesOrIndexesId),
457
+ const createIndexIds = (indexesOrIndexesId) =>
458
+ createListenable(resolveIndexes(indexesOrIndexesId), INDEX + IDS, EMPTY_ARR);
459
+ const createSliceIds = (indexId, indexesOrIndexesId) =>
460
+ createListenable(
461
+ resolveIndexes(indexesOrIndexesId),
446
462
  SLICE + IDS,
447
463
  EMPTY_ARR,
448
464
  () => [maybeGet(indexId)],
449
465
  );
450
- const useSliceRowIds = (indexId, sliceId, indexesOrIndexesId) =>
451
- useListenable(
452
- useIndexesOrIndexesById(indexesOrIndexesId),
466
+ const createSliceRowIds = (indexId, sliceId, indexesOrIndexesId) =>
467
+ createListenable(
468
+ resolveIndexes(indexesOrIndexesId),
453
469
  SLICE + ROW_IDS,
454
470
  EMPTY_ARR,
455
471
  () => [maybeGet(indexId), maybeGet(sliceId)],
456
472
  );
457
473
 
458
- const useIndexStoreTableId = (indexesOrId, indexId) => {
459
- const getI = useIndexesOrIndexesById(indexesOrId);
474
+ const getIndexStoreTableId = (indexesOrId, indexId) => {
475
+ const getIndexes2 = resolveIndexes(indexesOrId);
460
476
 
461
477
  return {
462
478
  get store() {
463
- return getI()?.getStore();
479
+ return getIndexes2()?.getStore();
464
480
  },
465
481
 
466
482
  get tableId() {
467
- return getI()?.getTableId(maybeGet(indexId));
483
+ return getIndexes2()?.getTableId(maybeGet(indexId));
468
484
  },
469
485
  };
470
486
  };
471
487
 
472
- const useQueries = (id) => useThing(id, OFFSET_QUERIES);
488
+ const getQueries = (id) => getProvidedThing(id, OFFSET_QUERIES);
473
489
 
474
- const useQueriesIds = () => {
490
+ const createQueriesIds = () => {
475
491
  const contextValue = getContextValue();
476
492
  let ids = $.state($.proxy(getThingIds(contextValue, OFFSET_QUERIES)));
477
493
 
478
- if (typeof window !== 'undefined') {
494
+ if (hasWindow()) {
479
495
  $.user_effect(() => {
480
496
  $.set(ids, getThingIds(contextValue, OFFSET_QUERIES), true);
481
497
  });
@@ -488,42 +504,38 @@ const useQueriesIds = () => {
488
504
  };
489
505
  };
490
506
 
491
- const useQueryIds = (queriesOrQueriesId) =>
492
- useListenable(
493
- useQueriesOrQueriesById(queriesOrQueriesId),
494
- QUERY + IDS,
495
- EMPTY_ARR,
496
- );
497
- const useResultTable = (queryId, queriesOrQueriesId) =>
498
- useListenable(
499
- useQueriesOrQueriesById(queriesOrQueriesId),
507
+ const createQueryIds = (queriesOrQueriesId) =>
508
+ createListenable(resolveQueries(queriesOrQueriesId), QUERY + IDS, EMPTY_ARR);
509
+ const createResultTable = (queryId, queriesOrQueriesId) =>
510
+ createListenable(
511
+ resolveQueries(queriesOrQueriesId),
500
512
  RESULT + TABLE,
501
513
  EMPTY_OBJ,
502
514
  () => [maybeGet(queryId)],
503
515
  );
504
- const useResultTableCellIds = (queryId, queriesOrQueriesId) =>
505
- useListenable(
506
- useQueriesOrQueriesById(queriesOrQueriesId),
516
+ const createResultTableCellIds = (queryId, queriesOrQueriesId) =>
517
+ createListenable(
518
+ resolveQueries(queriesOrQueriesId),
507
519
  RESULT + TABLE + CELL_IDS,
508
520
  EMPTY_ARR,
509
521
  () => [maybeGet(queryId)],
510
522
  );
511
- const useResultRowCount = (queryId, queriesOrQueriesId) =>
512
- useListenable(
513
- useQueriesOrQueriesById(queriesOrQueriesId),
523
+ const createResultRowCount = (queryId, queriesOrQueriesId) =>
524
+ createListenable(
525
+ resolveQueries(queriesOrQueriesId),
514
526
  RESULT + ROW_COUNT,
515
527
  0,
516
528
  () => [maybeGet(queryId)],
517
529
  );
518
- const useResultRowIds = (queryId, queriesOrQueriesId) =>
519
- useListenable(
520
- useQueriesOrQueriesById(queriesOrQueriesId),
530
+ const createResultRowIds = (queryId, queriesOrQueriesId) =>
531
+ createListenable(
532
+ resolveQueries(queriesOrQueriesId),
521
533
  RESULT + ROW_IDS,
522
534
  EMPTY_ARR,
523
535
  () => [maybeGet(queryId)],
524
536
  );
525
537
 
526
- const useResultSortedRowIds = (
538
+ const createResultSortedRowIds = (
527
539
  queryId,
528
540
  cellId,
529
541
  descending = false,
@@ -531,8 +543,8 @@ const useResultSortedRowIds = (
531
543
  limit,
532
544
  queriesOrQueriesId,
533
545
  ) =>
534
- useListenable(
535
- useQueriesOrQueriesById(queriesOrQueriesId),
546
+ createListenable(
547
+ resolveQueries(queriesOrQueriesId),
536
548
  RESULT + SORTED_ROW_IDS,
537
549
  EMPTY_ARR,
538
550
  () => [
@@ -544,34 +556,34 @@ const useResultSortedRowIds = (
544
556
  ],
545
557
  );
546
558
 
547
- const useResultRow = (queryId, rowId, queriesOrQueriesId) =>
548
- useListenable(
549
- useQueriesOrQueriesById(queriesOrQueriesId),
559
+ const createResultRow = (queryId, rowId, queriesOrQueriesId) =>
560
+ createListenable(
561
+ resolveQueries(queriesOrQueriesId),
550
562
  RESULT + ROW,
551
563
  EMPTY_OBJ,
552
564
  () => [maybeGet(queryId), maybeGet(rowId)],
553
565
  );
554
- const useResultCellIds = (queryId, rowId, queriesOrQueriesId) =>
555
- useListenable(
556
- useQueriesOrQueriesById(queriesOrQueriesId),
566
+ const createResultCellIds = (queryId, rowId, queriesOrQueriesId) =>
567
+ createListenable(
568
+ resolveQueries(queriesOrQueriesId),
557
569
  RESULT + CELL_IDS,
558
570
  EMPTY_ARR,
559
571
  () => [maybeGet(queryId), maybeGet(rowId)],
560
572
  );
561
- const useResultCell = (queryId, rowId, cellId, queriesOrQueriesId) =>
562
- useListenable(
563
- useQueriesOrQueriesById(queriesOrQueriesId),
573
+ const createResultCell = (queryId, rowId, cellId, queriesOrQueriesId) =>
574
+ createListenable(
575
+ resolveQueries(queriesOrQueriesId),
564
576
  RESULT + CELL,
565
577
  void 0,
566
578
  () => [maybeGet(queryId), maybeGet(rowId), maybeGet(cellId)],
567
579
  );
568
- const useRelationships = (id) => useThing(id, OFFSET_RELATIONSHIPS);
580
+ const getRelationships = (id) => getProvidedThing(id, OFFSET_RELATIONSHIPS);
569
581
 
570
- const useRelationshipsIds = () => {
582
+ const createRelationshipsIds = () => {
571
583
  const contextValue = getContextValue();
572
584
  let ids = $.state($.proxy(getThingIds(contextValue, OFFSET_RELATIONSHIPS)));
573
585
 
574
- if (typeof window !== 'undefined') {
586
+ if (hasWindow()) {
575
587
  $.user_effect(() => {
576
588
  $.set(ids, getThingIds(contextValue, OFFSET_RELATIONSHIPS), true);
577
589
  });
@@ -584,71 +596,71 @@ const useRelationshipsIds = () => {
584
596
  };
585
597
  };
586
598
 
587
- const useRelationshipIds = (relationshipsOrRelationshipsId) =>
588
- useListenable(
589
- useRelationshipsOrRelationshipsById(relationshipsOrRelationshipsId),
599
+ const createRelationshipIds = (relationshipsOrRelationshipsId) =>
600
+ createListenable(
601
+ resolveRelationships(relationshipsOrRelationshipsId),
590
602
  RELATIONSHIP + IDS,
591
603
  EMPTY_ARR,
592
604
  );
593
- const useRemoteRowId = (
605
+ const createRemoteRowId = (
594
606
  relationshipId,
595
607
  localRowId,
596
608
  relationshipsOrRelationshipsId,
597
609
  ) =>
598
- useListenable(
599
- useRelationshipsOrRelationshipsById(relationshipsOrRelationshipsId),
610
+ createListenable(
611
+ resolveRelationships(relationshipsOrRelationshipsId),
600
612
  REMOTE_ROW_ID,
601
613
  void 0,
602
614
  () => [maybeGet(relationshipId), maybeGet(localRowId)],
603
615
  );
604
- const useLocalRowIds = (
616
+ const createLocalRowIds = (
605
617
  relationshipId,
606
618
  remoteRowId,
607
619
  relationshipsOrRelationshipsId,
608
620
  ) =>
609
- useListenable(
610
- useRelationshipsOrRelationshipsById(relationshipsOrRelationshipsId),
621
+ createListenable(
622
+ resolveRelationships(relationshipsOrRelationshipsId),
611
623
  LOCAL + ROW_IDS,
612
624
  EMPTY_ARR,
613
625
  () => [maybeGet(relationshipId), maybeGet(remoteRowId)],
614
626
  );
615
- const useLinkedRowIds = (
627
+ const createLinkedRowIds = (
616
628
  relationshipId,
617
629
  firstRowId,
618
630
  relationshipsOrRelationshipsId,
619
631
  ) =>
620
- useListenable(
621
- useRelationshipsOrRelationshipsById(relationshipsOrRelationshipsId),
632
+ createListenable(
633
+ resolveRelationships(relationshipsOrRelationshipsId),
622
634
  LINKED + ROW_IDS,
623
635
  EMPTY_ARR,
624
636
  () => [maybeGet(relationshipId), maybeGet(firstRowId)],
625
637
  );
626
638
 
627
- const useRelationshipsStoreTableIds = (relationshipsOrId, relationshipId) => {
628
- const getR = useRelationshipsOrRelationshipsById(relationshipsOrId);
639
+ const getRelationshipsStoreTableIds = (relationshipsOrId, relationshipId) => {
640
+ const getRelationships2 = resolveRelationships(relationshipsOrId);
629
641
 
630
642
  return {
631
643
  get store() {
632
- return getR()?.getStore();
644
+ return getRelationships2()?.getStore();
633
645
  },
634
646
 
635
647
  get localTableId() {
636
- return getR()?.getLocalTableId(maybeGet(relationshipId));
648
+ return getRelationships2()?.getLocalTableId(maybeGet(relationshipId));
637
649
  },
638
650
 
639
651
  get remoteTableId() {
640
- return getR()?.getRemoteTableId(maybeGet(relationshipId));
652
+ return getRelationships2()?.getRemoteTableId(maybeGet(relationshipId));
641
653
  },
642
654
  };
643
655
  };
644
656
 
645
- const useCheckpoints = (id) => useThing(id, OFFSET_CHECKPOINTS);
657
+ const getCheckpoints = (id) => getProvidedThing(id, OFFSET_CHECKPOINTS);
646
658
 
647
- const useCheckpointsIds = () => {
659
+ const createCheckpointsIds = () => {
648
660
  const contextValue = getContextValue();
649
661
  let ids = $.state($.proxy(getThingIds(contextValue, OFFSET_CHECKPOINTS)));
650
662
 
651
- if (typeof window !== 'undefined') {
663
+ if (hasWindow()) {
652
664
  $.user_effect(() => {
653
665
  $.set(ids, getThingIds(contextValue, OFFSET_CHECKPOINTS), true);
654
666
  });
@@ -661,39 +673,39 @@ const useCheckpointsIds = () => {
661
673
  };
662
674
  };
663
675
 
664
- const useCheckpointIds = (checkpointsOrCheckpointsId) =>
665
- useListenable(
666
- useCheckpointsOrCheckpointsById(checkpointsOrCheckpointsId),
676
+ const createCheckpointIds = (checkpointsOrCheckpointsId) =>
677
+ createListenable(
678
+ resolveCheckpoints(checkpointsOrCheckpointsId),
667
679
  CHECKPOINT + IDS,
668
680
  DEFAULT_CHECKPOINT_IDS,
669
681
  );
670
- const useCheckpoint = (checkpointId, checkpointsOrCheckpointsId) =>
671
- useListenable(
672
- useCheckpointsOrCheckpointsById(checkpointsOrCheckpointsId),
682
+ const createCheckpoint = (checkpointId, checkpointsOrCheckpointsId) =>
683
+ createListenable(
684
+ resolveCheckpoints(checkpointsOrCheckpointsId),
673
685
  CHECKPOINT,
674
686
  void 0,
675
687
  () => [maybeGet(checkpointId)],
676
688
  );
677
689
 
678
- const useGoBackwardCallback = (checkpointsOrCheckpointsId) => {
679
- const getC = useCheckpointsOrCheckpointsById(checkpointsOrCheckpointsId);
690
+ const createGoBackwardCallback = (checkpointsOrCheckpointsId) => {
691
+ const getCheckpoints2 = resolveCheckpoints(checkpointsOrCheckpointsId);
680
692
 
681
- return () => getC()?.goBackward();
693
+ return () => getCheckpoints2()?.goBackward();
682
694
  };
683
695
 
684
- const useGoForwardCallback = (checkpointsOrCheckpointsId) => {
685
- const getC = useCheckpointsOrCheckpointsById(checkpointsOrCheckpointsId);
696
+ const createGoForwardCallback = (checkpointsOrCheckpointsId) => {
697
+ const getCheckpoints2 = resolveCheckpoints(checkpointsOrCheckpointsId);
686
698
 
687
- return () => getC()?.goForward();
699
+ return () => getCheckpoints2()?.goForward();
688
700
  };
689
701
 
690
- const usePersister = (id) => useThing(id, OFFSET_PERSISTER);
702
+ const getPersister = (id) => getProvidedThing(id, OFFSET_PERSISTER);
691
703
 
692
- const usePersisterIds = () => {
704
+ const createPersisterIds = () => {
693
705
  const contextValue = getContextValue();
694
706
  let ids = $.state($.proxy(getThingIds(contextValue, OFFSET_PERSISTER)));
695
707
 
696
- if (typeof window !== 'undefined') {
708
+ if (hasWindow()) {
697
709
  $.user_effect(() => {
698
710
  $.set(ids, getThingIds(contextValue, OFFSET_PERSISTER), true);
699
711
  });
@@ -706,15 +718,15 @@ const usePersisterIds = () => {
706
718
  };
707
719
  };
708
720
 
709
- const usePersisterStatus = (persisterOrPersisterId) =>
710
- useListenable(usePersisterOrPersisterById(persisterOrPersisterId), STATUS, 0);
711
- const useSynchronizer = (id) => useThing(id, OFFSET_SYNCHRONIZER);
721
+ const createPersisterStatus = (persisterOrPersisterId) =>
722
+ createListenable(resolvePersister(persisterOrPersisterId), STATUS, 0);
723
+ const getSynchronizer = (id) => getProvidedThing(id, OFFSET_SYNCHRONIZER);
712
724
 
713
- const useSynchronizerIds = () => {
725
+ const createSynchronizerIds = () => {
714
726
  const contextValue = getContextValue();
715
727
  let ids = $.state($.proxy(getThingIds(contextValue, OFFSET_SYNCHRONIZER)));
716
728
 
717
- if (typeof window !== 'undefined') {
729
+ if (hasWindow()) {
718
730
  $.user_effect(() => {
719
731
  $.set(ids, getThingIds(contextValue, OFFSET_SYNCHRONIZER), true);
720
732
  });
@@ -727,92 +739,86 @@ const useSynchronizerIds = () => {
727
739
  };
728
740
  };
729
741
 
730
- const useSynchronizerStatus = (synchronizerOrSynchronizerId) =>
731
- useListenable(
732
- useSynchronizerOrSynchronizerById(synchronizerOrSynchronizerId),
742
+ const createSynchronizerStatus = (synchronizerOrSynchronizerId) =>
743
+ createListenable(
744
+ resolveSynchronizer(synchronizerOrSynchronizerId),
733
745
  STATUS,
734
746
  0,
735
747
  );
736
- const useHasTablesListener = (listener, mutator, storeOrStoreId) =>
737
- useListener(
738
- useStoreOrStoreById(storeOrStoreId),
748
+ const onHasTables = (listener, mutator, storeOrStoreId) =>
749
+ addListenerEffect(
750
+ resolveStore(storeOrStoreId),
739
751
  HAS + TABLES,
740
752
  listener,
741
753
  () => EMPTY_ARR,
742
754
  mutator,
743
755
  );
744
- const useTablesListener = (listener, mutator, storeOrStoreId) =>
745
- useListener(
746
- useStoreOrStoreById(storeOrStoreId),
756
+ const onTables = (listener, mutator, storeOrStoreId) =>
757
+ addListenerEffect(
758
+ resolveStore(storeOrStoreId),
747
759
  TABLES,
748
760
  listener,
749
761
  () => EMPTY_ARR,
750
762
  mutator,
751
763
  );
752
- const useTableIdsListener = (listener, mutator, storeOrStoreId) =>
753
- useListener(
754
- useStoreOrStoreById(storeOrStoreId),
764
+ const onTableIds = (listener, mutator, storeOrStoreId) =>
765
+ addListenerEffect(
766
+ resolveStore(storeOrStoreId),
755
767
  TABLE_IDS,
756
768
  listener,
757
769
  () => EMPTY_ARR,
758
770
  mutator,
759
771
  );
760
- const useHasTableListener = (tableId, listener, mutator, storeOrStoreId) =>
761
- useListener(
762
- useStoreOrStoreById(storeOrStoreId),
772
+ const onHasTable = (tableId, listener, mutator, storeOrStoreId) =>
773
+ addListenerEffect(
774
+ resolveStore(storeOrStoreId),
763
775
  HAS + TABLE,
764
776
  listener,
765
777
  () => [maybeGet(tableId)],
766
778
  mutator,
767
779
  );
768
- const useTableListener = (tableId, listener, mutator, storeOrStoreId) =>
769
- useListener(
770
- useStoreOrStoreById(storeOrStoreId),
780
+ const onTable = (tableId, listener, mutator, storeOrStoreId) =>
781
+ addListenerEffect(
782
+ resolveStore(storeOrStoreId),
771
783
  TABLE,
772
784
  listener,
773
785
  () => [maybeGet(tableId)],
774
786
  mutator,
775
787
  );
776
- const useTableCellIdsListener = (tableId, listener, mutator, storeOrStoreId) =>
777
- useListener(
778
- useStoreOrStoreById(storeOrStoreId),
788
+ const onTableCellIds = (tableId, listener, mutator, storeOrStoreId) =>
789
+ addListenerEffect(
790
+ resolveStore(storeOrStoreId),
779
791
  TABLE + CELL_IDS,
780
792
  listener,
781
793
  () => [maybeGet(tableId)],
782
794
  mutator,
783
795
  );
784
- const useHasTableCellListener = (
785
- tableId,
786
- cellId,
787
- listener,
788
- mutator,
789
- storeOrStoreId,
790
- ) =>
791
- useListener(
792
- useStoreOrStoreById(storeOrStoreId),
796
+ const onHasTableCell = (tableId, cellId, listener, mutator, storeOrStoreId) =>
797
+ addListenerEffect(
798
+ resolveStore(storeOrStoreId),
793
799
  HAS + TABLE + CELL,
794
800
  listener,
795
801
  () => [maybeGet(tableId), maybeGet(cellId)],
796
802
  mutator,
797
803
  );
798
- const useRowCountListener = (tableId, listener, mutator, storeOrStoreId) =>
799
- useListener(
800
- useStoreOrStoreById(storeOrStoreId),
804
+ const onRowCount = (tableId, listener, mutator, storeOrStoreId) =>
805
+ addListenerEffect(
806
+ resolveStore(storeOrStoreId),
801
807
  ROW_COUNT,
802
808
  listener,
803
809
  () => [maybeGet(tableId)],
804
810
  mutator,
805
811
  );
806
- const useRowIdsListener = (tableId, listener, mutator, storeOrStoreId) =>
807
- useListener(
808
- useStoreOrStoreById(storeOrStoreId),
812
+ const onRowIds = (tableId, listener, mutator, storeOrStoreId) =>
813
+ addListenerEffect(
814
+ resolveStore(storeOrStoreId),
809
815
  ROW_IDS,
810
816
  listener,
811
817
  () => [maybeGet(tableId)],
812
818
  mutator,
813
819
  );
814
820
 
815
- const useSortedRowIdsListener = (
821
+ const onSortedRowIds = (
816
822
  tableId,
817
823
  cellId,
818
824
  descending,
@@ -822,8 +828,8 @@ const useSortedRowIdsListener = (
822
828
  mutator,
823
829
  storeOrStoreId,
824
830
  ) =>
825
- useListener(
826
- useStoreOrStoreById(storeOrStoreId),
831
+ addListenerEffect(
832
+ resolveStore(storeOrStoreId),
827
833
  SORTED_ROW_IDS,
828
834
  listener,
829
835
  () => [
@@ -836,220 +842,195 @@ const useSortedRowIdsListener = (
836
842
  mutator,
837
843
  );
838
844
 
839
- const useHasRowListener = (tableId, rowId, listener, mutator, storeOrStoreId) =>
840
- useListener(
841
- useStoreOrStoreById(storeOrStoreId),
845
+ const onHasRow = (tableId, rowId, listener, mutator, storeOrStoreId) =>
846
+ addListenerEffect(
847
+ resolveStore(storeOrStoreId),
842
848
  HAS + ROW,
843
849
  listener,
844
850
  () => [maybeGet(tableId), maybeGet(rowId)],
845
851
  mutator,
846
852
  );
847
- const useRowListener = (tableId, rowId, listener, mutator, storeOrStoreId) =>
848
- useListener(
849
- useStoreOrStoreById(storeOrStoreId),
853
+ const onRow = (tableId, rowId, listener, mutator, storeOrStoreId) =>
854
+ addListenerEffect(
855
+ resolveStore(storeOrStoreId),
850
856
  ROW,
851
857
  listener,
852
858
  () => [maybeGet(tableId), maybeGet(rowId)],
853
859
  mutator,
854
860
  );
855
- const useCellIdsListener = (
856
- tableId,
857
- rowId,
858
- listener,
859
- mutator,
860
- storeOrStoreId,
861
- ) =>
862
- useListener(
863
- useStoreOrStoreById(storeOrStoreId),
861
+ const onCellIds = (tableId, rowId, listener, mutator, storeOrStoreId) =>
862
+ addListenerEffect(
863
+ resolveStore(storeOrStoreId),
864
864
  CELL_IDS,
865
865
  listener,
866
866
  () => [maybeGet(tableId), maybeGet(rowId)],
867
867
  mutator,
868
868
  );
869
- const useHasCellListener = (
870
- tableId,
871
- rowId,
872
- cellId,
873
- listener,
874
- mutator,
875
- storeOrStoreId,
876
- ) =>
877
- useListener(
878
- useStoreOrStoreById(storeOrStoreId),
869
+ const onHasCell = (tableId, rowId, cellId, listener, mutator, storeOrStoreId) =>
870
+ addListenerEffect(
871
+ resolveStore(storeOrStoreId),
879
872
  HAS + CELL,
880
873
  listener,
881
874
  () => [maybeGet(tableId), maybeGet(rowId), maybeGet(cellId)],
882
875
  mutator,
883
876
  );
884
- const useCellListener = (
885
- tableId,
886
- rowId,
887
- cellId,
888
- listener,
889
- mutator,
890
- storeOrStoreId,
891
- ) =>
892
- useListener(
893
- useStoreOrStoreById(storeOrStoreId),
877
+ const onCell = (tableId, rowId, cellId, listener, mutator, storeOrStoreId) =>
878
+ addListenerEffect(
879
+ resolveStore(storeOrStoreId),
894
880
  CELL,
895
881
  listener,
896
882
  () => [maybeGet(tableId), maybeGet(rowId), maybeGet(cellId)],
897
883
  mutator,
898
884
  );
899
- const useHasValuesListener = (listener, mutator, storeOrStoreId) =>
900
- useListener(
901
- useStoreOrStoreById(storeOrStoreId),
885
+ const onHasValues = (listener, mutator, storeOrStoreId) =>
886
+ addListenerEffect(
887
+ resolveStore(storeOrStoreId),
902
888
  HAS + VALUES,
903
889
  listener,
904
890
  () => EMPTY_ARR,
905
891
  mutator,
906
892
  );
907
- const useValuesListener = (listener, mutator, storeOrStoreId) =>
908
- useListener(
909
- useStoreOrStoreById(storeOrStoreId),
893
+ const onValues = (listener, mutator, storeOrStoreId) =>
894
+ addListenerEffect(
895
+ resolveStore(storeOrStoreId),
910
896
  VALUES,
911
897
  listener,
912
898
  () => EMPTY_ARR,
913
899
  mutator,
914
900
  );
915
- const useValueIdsListener = (listener, mutator, storeOrStoreId) =>
916
- useListener(
917
- useStoreOrStoreById(storeOrStoreId),
901
+ const onValueIds = (listener, mutator, storeOrStoreId) =>
902
+ addListenerEffect(
903
+ resolveStore(storeOrStoreId),
918
904
  VALUE_IDS,
919
905
  listener,
920
906
  () => EMPTY_ARR,
921
907
  mutator,
922
908
  );
923
- const useHasValueListener = (valueId, listener, mutator, storeOrStoreId) =>
924
- useListener(
925
- useStoreOrStoreById(storeOrStoreId),
909
+ const onHasValue = (valueId, listener, mutator, storeOrStoreId) =>
910
+ addListenerEffect(
911
+ resolveStore(storeOrStoreId),
926
912
  HAS + VALUE,
927
913
  listener,
928
914
  () => [maybeGet(valueId)],
929
915
  mutator,
930
916
  );
931
- const useValueListener = (valueId, listener, mutator, storeOrStoreId) =>
932
- useListener(
933
- useStoreOrStoreById(storeOrStoreId),
917
+ const onValue = (valueId, listener, mutator, storeOrStoreId) =>
918
+ addListenerEffect(
919
+ resolveStore(storeOrStoreId),
934
920
  VALUE,
935
921
  listener,
936
922
  () => [maybeGet(valueId)],
937
923
  mutator,
938
924
  );
939
- const useStartTransactionListener = (listener, storeOrStoreId) =>
940
- useListener(
941
- useStoreOrStoreById(storeOrStoreId),
925
+ const onStartTransaction = (listener, storeOrStoreId) =>
926
+ addListenerEffect(
927
+ resolveStore(storeOrStoreId),
942
928
  'Start' + TRANSACTION,
943
929
  listener,
944
930
  );
945
- const useWillFinishTransactionListener = (listener, storeOrStoreId) =>
946
- useListener(
947
- useStoreOrStoreById(storeOrStoreId),
931
+ const onWillFinishTransaction = (listener, storeOrStoreId) =>
932
+ addListenerEffect(
933
+ resolveStore(storeOrStoreId),
948
934
  'Will' + FINISH + TRANSACTION,
949
935
  listener,
950
936
  );
951
- const useDidFinishTransactionListener = (listener, storeOrStoreId) =>
952
- useListener(
953
- useStoreOrStoreById(storeOrStoreId),
937
+ const onDidFinishTransaction = (listener, storeOrStoreId) =>
938
+ addListenerEffect(
939
+ resolveStore(storeOrStoreId),
954
940
  'Did' + FINISH + TRANSACTION,
955
941
  listener,
956
942
  );
957
- const useMetricListener = (metricId, listener, metricsOrMetricsId) =>
958
- useListener(
959
- useMetricsOrMetricsById(metricsOrMetricsId),
943
+ const onMetric = (metricId, listener, metricsOrMetricsId) =>
944
+ addListenerEffect(
945
+ resolveMetrics(metricsOrMetricsId),
960
946
  METRIC,
961
947
  listener,
962
948
  () => [maybeGet(metricId)],
963
949
  );
964
- const useSliceIdsListener = (indexId, listener, indexesOrIndexesId) =>
965
- useListener(
966
- useIndexesOrIndexesById(indexesOrIndexesId),
950
+ const onSliceIds = (indexId, listener, indexesOrIndexesId) =>
951
+ addListenerEffect(
952
+ resolveIndexes(indexesOrIndexesId),
967
953
  SLICE + IDS,
968
954
  listener,
969
955
  () => [maybeGet(indexId)],
970
956
  );
971
- const useSliceRowIdsListener = (
972
- indexId,
973
- sliceId,
974
- listener,
975
- indexesOrIndexesId,
976
- ) =>
977
- useListener(
978
- useIndexesOrIndexesById(indexesOrIndexesId),
957
+ const onSliceRowIds = (indexId, sliceId, listener, indexesOrIndexesId) =>
958
+ addListenerEffect(
959
+ resolveIndexes(indexesOrIndexesId),
979
960
  SLICE + ROW_IDS,
980
961
  listener,
981
962
  () => [maybeGet(indexId), maybeGet(sliceId)],
982
963
  );
983
964
 
984
- const useRemoteRowIdListener = (
965
+ const onRemoteRowId = (
985
966
  relationshipId,
986
967
  localRowId,
987
968
  listener,
988
969
  relationshipsOrRelationshipsId,
989
970
  ) =>
990
- useListener(
991
- useRelationshipsOrRelationshipsById(relationshipsOrRelationshipsId),
971
+ addListenerEffect(
972
+ resolveRelationships(relationshipsOrRelationshipsId),
992
973
  REMOTE_ROW_ID,
993
974
  listener,
994
975
  () => [maybeGet(relationshipId), maybeGet(localRowId)],
995
976
  );
996
977
 
997
- const useLocalRowIdsListener = (
978
+ const onLocalRowIds = (
998
979
  relationshipId,
999
980
  remoteRowId,
1000
981
  listener,
1001
982
  relationshipsOrRelationshipsId,
1002
983
  ) =>
1003
- useListener(
1004
- useRelationshipsOrRelationshipsById(relationshipsOrRelationshipsId),
984
+ addListenerEffect(
985
+ resolveRelationships(relationshipsOrRelationshipsId),
1005
986
  LOCAL + ROW_IDS,
1006
987
  listener,
1007
988
  () => [maybeGet(relationshipId), maybeGet(remoteRowId)],
1008
989
  );
1009
990
 
1010
- const useLinkedRowIdsListener = (
991
+ const onLinkedRowIds = (
1011
992
  relationshipId,
1012
993
  firstRowId,
1013
994
  listener,
1014
995
  relationshipsOrRelationshipsId,
1015
996
  ) =>
1016
- useListener(
1017
- useRelationshipsOrRelationshipsById(relationshipsOrRelationshipsId),
997
+ addListenerEffect(
998
+ resolveRelationships(relationshipsOrRelationshipsId),
1018
999
  LINKED + ROW_IDS,
1019
1000
  listener,
1020
1001
  () => [maybeGet(relationshipId), maybeGet(firstRowId)],
1021
1002
  );
1022
1003
 
1023
- const useResultTableListener = (queryId, listener, queriesOrQueriesId) =>
1024
- useListener(
1025
- useQueriesOrQueriesById(queriesOrQueriesId),
1004
+ const onResultTable = (queryId, listener, queriesOrQueriesId) =>
1005
+ addListenerEffect(
1006
+ resolveQueries(queriesOrQueriesId),
1026
1007
  RESULT + TABLE,
1027
1008
  listener,
1028
1009
  () => [maybeGet(queryId)],
1029
1010
  );
1030
- const useResultTableCellIdsListener = (queryId, listener, queriesOrQueriesId) =>
1031
- useListener(
1032
- useQueriesOrQueriesById(queriesOrQueriesId),
1011
+ const onResultTableCellIds = (queryId, listener, queriesOrQueriesId) =>
1012
+ addListenerEffect(
1013
+ resolveQueries(queriesOrQueriesId),
1033
1014
  RESULT + TABLE + CELL_IDS,
1034
1015
  listener,
1035
1016
  () => [maybeGet(queryId)],
1036
1017
  );
1037
- const useResultRowCountListener = (queryId, listener, queriesOrQueriesId) =>
1038
- useListener(
1039
- useQueriesOrQueriesById(queriesOrQueriesId),
1018
+ const onResultRowCount = (queryId, listener, queriesOrQueriesId) =>
1019
+ addListenerEffect(
1020
+ resolveQueries(queriesOrQueriesId),
1040
1021
  RESULT + ROW_COUNT,
1041
1022
  listener,
1042
1023
  () => [maybeGet(queryId)],
1043
1024
  );
1044
- const useResultRowIdsListener = (queryId, listener, queriesOrQueriesId) =>
1045
- useListener(
1046
- useQueriesOrQueriesById(queriesOrQueriesId),
1025
+ const onResultRowIds = (queryId, listener, queriesOrQueriesId) =>
1026
+ addListenerEffect(
1027
+ resolveQueries(queriesOrQueriesId),
1047
1028
  RESULT + ROW_IDS,
1048
1029
  listener,
1049
1030
  () => [maybeGet(queryId)],
1050
1031
  );
1051
1032
 
1052
- const useResultSortedRowIdsListener = (
1033
+ const onResultSortedRowIds = (
1053
1034
  queryId,
1054
1035
  cellId,
1055
1036
  descending,
@@ -1058,8 +1039,8 @@ const useResultSortedRowIdsListener = (
1058
1039
  listener,
1059
1040
  queriesOrQueriesId,
1060
1041
  ) =>
1061
- useListener(
1062
- useQueriesOrQueriesById(queriesOrQueriesId),
1042
+ addListenerEffect(
1043
+ resolveQueries(queriesOrQueriesId),
1063
1044
  RESULT + SORTED_ROW_IDS,
1064
1045
  listener,
1065
1046
  () => [
@@ -1071,86 +1052,59 @@ const useResultSortedRowIdsListener = (
1071
1052
  ],
1072
1053
  );
1073
1054
 
1074
- const useResultRowListener = (queryId, rowId, listener, queriesOrQueriesId) =>
1075
- useListener(
1076
- useQueriesOrQueriesById(queriesOrQueriesId),
1055
+ const onResultRow = (queryId, rowId, listener, queriesOrQueriesId) =>
1056
+ addListenerEffect(
1057
+ resolveQueries(queriesOrQueriesId),
1077
1058
  RESULT + ROW,
1078
1059
  listener,
1079
1060
  () => [maybeGet(queryId), maybeGet(rowId)],
1080
1061
  );
1081
- const useResultCellIdsListener = (
1082
- queryId,
1083
- rowId,
1084
- listener,
1085
- queriesOrQueriesId,
1086
- ) =>
1087
- useListener(
1088
- useQueriesOrQueriesById(queriesOrQueriesId),
1062
+ const onResultCellIds = (queryId, rowId, listener, queriesOrQueriesId) =>
1063
+ addListenerEffect(
1064
+ resolveQueries(queriesOrQueriesId),
1089
1065
  RESULT + CELL_IDS,
1090
1066
  listener,
1091
1067
  () => [maybeGet(queryId), maybeGet(rowId)],
1092
1068
  );
1093
- const useResultCellListener = (
1094
- queryId,
1095
- rowId,
1096
- cellId,
1097
- listener,
1098
- queriesOrQueriesId,
1099
- ) =>
1100
- useListener(
1101
- useQueriesOrQueriesById(queriesOrQueriesId),
1069
+ const onResultCell = (queryId, rowId, cellId, listener, queriesOrQueriesId) =>
1070
+ addListenerEffect(
1071
+ resolveQueries(queriesOrQueriesId),
1102
1072
  RESULT + CELL,
1103
1073
  listener,
1104
1074
  () => [maybeGet(queryId), maybeGet(rowId), maybeGet(cellId)],
1105
1075
  );
1106
- const useParamValuesListener = (queryId, listener, queriesOrQueriesId) =>
1107
- useListener(
1108
- useQueriesOrQueriesById(queriesOrQueriesId),
1076
+ const onParamValues = (queryId, listener, queriesOrQueriesId) =>
1077
+ addListenerEffect(
1078
+ resolveQueries(queriesOrQueriesId),
1109
1079
  'ParamValues',
1110
1080
  listener,
1111
1081
  () => [maybeGet(queryId)],
1112
1082
  );
1113
- const useParamValueListener = (
1114
- queryId,
1115
- paramId,
1116
- listener,
1117
- queriesOrQueriesId,
1118
- ) =>
1119
- useListener(
1120
- useQueriesOrQueriesById(queriesOrQueriesId),
1083
+ const onParamValue = (queryId, paramId, listener, queriesOrQueriesId) =>
1084
+ addListenerEffect(
1085
+ resolveQueries(queriesOrQueriesId),
1121
1086
  'ParamValue',
1122
1087
  listener,
1123
1088
  () => [maybeGet(queryId), maybeGet(paramId)],
1124
1089
  );
1125
- const useCheckpointIdsListener = (listener, checkpointsOrCheckpointsId) =>
1126
- useListener(
1127
- useCheckpointsOrCheckpointsById(checkpointsOrCheckpointsId),
1090
+ const onCheckpointIds = (listener, checkpointsOrCheckpointsId) =>
1091
+ addListenerEffect(
1092
+ resolveCheckpoints(checkpointsOrCheckpointsId),
1128
1093
  CHECKPOINT + IDS,
1129
1094
  listener,
1130
1095
  );
1131
- const useCheckpointListener = (
1132
- checkpointId,
1133
- listener,
1134
- checkpointsOrCheckpointsId,
1135
- ) =>
1136
- useListener(
1137
- useCheckpointsOrCheckpointsById(checkpointsOrCheckpointsId),
1096
+ const onCheckpoint = (checkpointId, listener, checkpointsOrCheckpointsId) =>
1097
+ addListenerEffect(
1098
+ resolveCheckpoints(checkpointsOrCheckpointsId),
1138
1099
  CHECKPOINT,
1139
1100
  listener,
1140
1101
  () => [maybeGet(checkpointId)],
1141
1102
  );
1142
- const usePersisterStatusListener = (listener, persisterOrPersisterId) =>
1143
- useListener(
1144
- usePersisterOrPersisterById(persisterOrPersisterId),
1145
- STATUS,
1146
- listener,
1147
- );
1148
- const useSynchronizerStatusListener = (
1149
- listener,
1150
- synchronizerOrSynchronizerId,
1151
- ) =>
1152
- useListener(
1153
- useSynchronizerOrSynchronizerById(synchronizerOrSynchronizerId),
1103
+ const onPersisterStatus = (listener, persisterOrPersisterId) =>
1104
+ addListenerEffect(resolvePersister(persisterOrPersisterId), STATUS, listener);
1105
+ const onSynchronizerStatus = (listener, synchronizerOrSynchronizerId) =>
1106
+ addListenerEffect(
1107
+ resolveSynchronizer(synchronizerOrSynchronizerId),
1154
1108
  STATUS,
1155
1109
  listener,
1156
1110
  );
@@ -1158,7 +1112,7 @@ const useSynchronizerStatusListener = (
1158
1112
  const provideThing = (thingId, thing, offset) => {
1159
1113
  const contextValue = getContextValue();
1160
1114
 
1161
- if (typeof window !== 'undefined') {
1115
+ if (hasWindow()) {
1162
1116
  $.user_effect(() => {
1163
1117
  contextValue[16]?.(offset, thingId, thing);
1164
1118
 
@@ -1187,7 +1141,7 @@ const provideSynchronizer = (synchronizerId, synchronizer) =>
1187
1141
  function CheckpointView($$anchor, $$props) {
1188
1142
  $.push($$props, true);
1189
1143
 
1190
- const checkpoint = useCheckpoint(
1144
+ const checkpoint = createCheckpoint(
1191
1145
  () => $$props.checkpointId,
1192
1146
  () => $$props.checkpoints,
1193
1147
  );
@@ -1318,7 +1272,7 @@ function Wrap($$anchor, $$props) {
1318
1272
  function BackwardCheckpointsView($$anchor, $$props) {
1319
1273
  $.push($$props, true);
1320
1274
 
1321
- const checkpointIds = useCheckpointIds(() => $$props.checkpoints);
1275
+ const checkpointIds = createCheckpointIds(() => $$props.checkpoints);
1322
1276
  const ids = $.derived(() => checkpointIds.current[0]);
1323
1277
 
1324
1278
  {
@@ -1365,7 +1319,7 @@ function BackwardCheckpointsView($$anchor, $$props) {
1365
1319
  function CellView($$anchor, $$props) {
1366
1320
  $.push($$props, true);
1367
1321
 
1368
- const cell = useCell(
1322
+ const cell = createCell(
1369
1323
  () => $$props.tableId,
1370
1324
  () => $$props.rowId,
1371
1325
  () => $$props.cellId,
@@ -1389,7 +1343,7 @@ function CellView($$anchor, $$props) {
1389
1343
  function CurrentCheckpointView($$anchor, $$props) {
1390
1344
  $.push($$props, true);
1391
1345
 
1392
- const checkpointIds = useCheckpointIds(() => $$props.checkpoints);
1346
+ const checkpointIds = createCheckpointIds(() => $$props.checkpoints);
1393
1347
  const currentId = $.derived(() => checkpointIds.current[1]);
1394
1348
  var fragment = $.comment();
1395
1349
  var node = $.first_child(fragment);
@@ -1451,7 +1405,7 @@ function CurrentCheckpointView($$anchor, $$props) {
1451
1405
  function ForwardCheckpointsView($$anchor, $$props) {
1452
1406
  $.push($$props, true);
1453
1407
 
1454
- const checkpointIds = useCheckpointIds(() => $$props.checkpoints);
1408
+ const checkpointIds = createCheckpointIds(() => $$props.checkpoints);
1455
1409
  const ids = $.derived(() => checkpointIds.current[2]);
1456
1410
 
1457
1411
  {
@@ -1498,7 +1452,7 @@ function ForwardCheckpointsView($$anchor, $$props) {
1498
1452
  function RowView($$anchor, $$props) {
1499
1453
  $.push($$props, true);
1500
1454
 
1501
- const defaultCellIds = useCellIds(
1455
+ const defaultCellIds = createCellIds(
1502
1456
  () => $$props.tableId,
1503
1457
  () => $$props.rowId,
1504
1458
  () => $$props.store,
@@ -1563,11 +1517,11 @@ function RowView($$anchor, $$props) {
1563
1517
  function SliceView($$anchor, $$props) {
1564
1518
  $.push($$props, true);
1565
1519
 
1566
- const {store, tableId} = useIndexStoreTableId(
1520
+ const {store, tableId} = getIndexStoreTableId(
1567
1521
  () => $$props.indexes,
1568
1522
  () => $$props.indexId,
1569
1523
  );
1570
- const rowIds = useSliceRowIds(
1524
+ const rowIds = createSliceRowIds(
1571
1525
  () => $$props.indexId,
1572
1526
  () => $$props.sliceId,
1573
1527
  () => $$props.indexes,
@@ -1638,7 +1592,7 @@ function SliceView($$anchor, $$props) {
1638
1592
  function IndexView($$anchor, $$props) {
1639
1593
  $.push($$props, true);
1640
1594
 
1641
- const sliceIds = useSliceIds(
1595
+ const sliceIds = createSliceIds(
1642
1596
  () => $$props.indexId,
1643
1597
  () => $$props.indexes,
1644
1598
  );
@@ -1695,11 +1649,11 @@ function IndexView($$anchor, $$props) {
1695
1649
  function LinkedRowsView($$anchor, $$props) {
1696
1650
  $.push($$props, true);
1697
1651
 
1698
- const {store, localTableId} = useRelationshipsStoreTableIds(
1652
+ const {store, localTableId} = getRelationshipsStoreTableIds(
1699
1653
  () => $$props.relationships,
1700
1654
  () => $$props.relationshipId,
1701
1655
  );
1702
- const rowIds = useLinkedRowIds(
1656
+ const rowIds = createLinkedRowIds(
1703
1657
  () => $$props.relationshipId,
1704
1658
  () => $$props.firstRowId,
1705
1659
  () => $$props.relationships,
@@ -1770,11 +1724,11 @@ function LinkedRowsView($$anchor, $$props) {
1770
1724
  function LocalRowsView($$anchor, $$props) {
1771
1725
  $.push($$props, true);
1772
1726
 
1773
- const {store, localTableId} = useRelationshipsStoreTableIds(
1727
+ const {store, localTableId} = getRelationshipsStoreTableIds(
1774
1728
  () => $$props.relationships,
1775
1729
  () => $$props.relationshipId,
1776
1730
  );
1777
- const rowIds = useLocalRowIds(
1731
+ const rowIds = createLocalRowIds(
1778
1732
  () => $$props.relationshipId,
1779
1733
  () => $$props.remoteRowId,
1780
1734
  () => $$props.relationships,
@@ -1845,7 +1799,7 @@ function LocalRowsView($$anchor, $$props) {
1845
1799
  function MetricView($$anchor, $$props) {
1846
1800
  $.push($$props, true);
1847
1801
 
1848
- const metric = useMetric(
1802
+ const metric = createMetric(
1849
1803
  () => $$props.metricId,
1850
1804
  () => $$props.metrics,
1851
1805
  );
@@ -1987,11 +1941,11 @@ var root = $.from_html(`<!><!><!>`, 1);
1987
1941
  function RemoteRowView($$anchor, $$props) {
1988
1942
  $.push($$props, true);
1989
1943
 
1990
- const {store, remoteTableId} = useRelationshipsStoreTableIds(
1944
+ const {store, remoteTableId} = getRelationshipsStoreTableIds(
1991
1945
  () => $$props.relationships,
1992
1946
  () => $$props.relationshipId,
1993
1947
  );
1994
- const remoteRowId = useRemoteRowId(
1948
+ const remoteRowId = createRemoteRowId(
1995
1949
  () => $$props.relationshipId,
1996
1950
  () => $$props.localRowId,
1997
1951
  () => $$props.relationships,
@@ -2092,7 +2046,7 @@ function RemoteRowView($$anchor, $$props) {
2092
2046
  function ResultCellView($$anchor, $$props) {
2093
2047
  $.push($$props, true);
2094
2048
 
2095
- const cell = useResultCell(
2049
+ const cell = createResultCell(
2096
2050
  () => $$props.queryId,
2097
2051
  () => $$props.rowId,
2098
2052
  () => $$props.cellId,
@@ -2116,7 +2070,7 @@ function ResultCellView($$anchor, $$props) {
2116
2070
  function ResultRowView($$anchor, $$props) {
2117
2071
  $.push($$props, true);
2118
2072
 
2119
- const cellIds = useResultCellIds(
2073
+ const cellIds = createResultCellIds(
2120
2074
  () => $$props.queryId,
2121
2075
  () => $$props.rowId,
2122
2076
  () => $$props.queries,
@@ -2178,7 +2132,7 @@ function ResultRowView($$anchor, $$props) {
2178
2132
  function ResultSortedTableView($$anchor, $$props) {
2179
2133
  $.push($$props, true);
2180
2134
 
2181
- const rowIds = useResultSortedRowIds(
2135
+ const rowIds = createResultSortedRowIds(
2182
2136
  () => $$props.queryId,
2183
2137
  () => $$props.cellId,
2184
2138
  () => $$props.descending ?? false,
@@ -2239,7 +2193,7 @@ function ResultSortedTableView($$anchor, $$props) {
2239
2193
  function ResultTableView($$anchor, $$props) {
2240
2194
  $.push($$props, true);
2241
2195
 
2242
- const rowIds = useResultRowIds(
2196
+ const rowIds = createResultRowIds(
2243
2197
  () => $$props.queryId,
2244
2198
  () => $$props.queries,
2245
2199
  );
@@ -2296,7 +2250,7 @@ function ResultTableView($$anchor, $$props) {
2296
2250
  function SortedTableView($$anchor, $$props) {
2297
2251
  $.push($$props, true);
2298
2252
 
2299
- const rowIds = useSortedRowIds(
2253
+ const rowIds = createSortedRowIds(
2300
2254
  () => $$props.tableId,
2301
2255
  () => $$props.cellId,
2302
2256
  () => $$props.descending ?? false,
@@ -2361,7 +2315,7 @@ function SortedTableView($$anchor, $$props) {
2361
2315
  function TableView($$anchor, $$props) {
2362
2316
  $.push($$props, true);
2363
2317
 
2364
- const rowIds = useRowIds(
2318
+ const rowIds = createRowIds(
2365
2319
  () => $$props.tableId,
2366
2320
  () => $$props.store,
2367
2321
  );
@@ -2422,7 +2376,7 @@ function TableView($$anchor, $$props) {
2422
2376
  function TablesView($$anchor, $$props) {
2423
2377
  $.push($$props, true);
2424
2378
 
2425
- const tableIds = useTableIds(() => $$props.store);
2379
+ const tableIds = createTableIds(() => $$props.store);
2426
2380
 
2427
2381
  {
2428
2382
  const children = ($$anchor, tableId = $.noop) => {
@@ -2468,7 +2422,7 @@ function TablesView($$anchor, $$props) {
2468
2422
  function ValueView($$anchor, $$props) {
2469
2423
  $.push($$props, true);
2470
2424
 
2471
- const value = useValue(
2425
+ const value = createValue(
2472
2426
  () => $$props.valueId,
2473
2427
  () => $$props.store,
2474
2428
  );
@@ -2492,7 +2446,7 @@ function ValueView($$anchor, $$props) {
2492
2446
  function ValuesView($$anchor, $$props) {
2493
2447
  $.push($$props, true);
2494
2448
 
2495
- const valueIds = useValueIds(() => $$props.store);
2449
+ const valueIds = createValueIds(() => $$props.store);
2496
2450
 
2497
2451
  {
2498
2452
  const children = ($$anchor, valueId = $.noop) => {
@@ -2539,12 +2493,117 @@ export {
2539
2493
  BackwardCheckpointsView,
2540
2494
  CellView,
2541
2495
  CheckpointView,
2496
+ createCell,
2497
+ createCellIds,
2498
+ createCheckpoint,
2499
+ createCheckpointIds,
2500
+ createCheckpointsIds,
2501
+ createGoBackwardCallback,
2502
+ createGoForwardCallback,
2503
+ createHasCell,
2504
+ createHasRow,
2505
+ createHasTable,
2506
+ createHasTableCell,
2507
+ createHasTables,
2508
+ createHasValue,
2509
+ createHasValues,
2510
+ createIndexesIds,
2511
+ createIndexIds,
2512
+ createLinkedRowIds,
2513
+ createLocalRowIds,
2514
+ createMetric,
2515
+ createMetricIds,
2516
+ createMetricsIds,
2517
+ createPersisterIds,
2518
+ createPersisterStatus,
2519
+ createQueriesIds,
2520
+ createQueryIds,
2521
+ createRelationshipIds,
2522
+ createRelationshipsIds,
2523
+ createRemoteRowId,
2524
+ createResultCell,
2525
+ createResultCellIds,
2526
+ createResultRow,
2527
+ createResultRowCount,
2528
+ createResultRowIds,
2529
+ createResultSortedRowIds,
2530
+ createResultTable,
2531
+ createResultTableCellIds,
2532
+ createRow,
2533
+ createRowCount,
2534
+ createRowIds,
2535
+ createSliceIds,
2536
+ createSliceRowIds,
2537
+ createSortedRowIds,
2538
+ createStoreIds,
2539
+ createSynchronizerIds,
2540
+ createSynchronizerStatus,
2541
+ createTable,
2542
+ createTableCellIds,
2543
+ createTableIds,
2544
+ createTables,
2545
+ createValue,
2546
+ createValueIds,
2547
+ createValues,
2542
2548
  CurrentCheckpointView,
2543
2549
  ForwardCheckpointsView,
2550
+ getCheckpoints,
2551
+ getIndexes,
2552
+ getIndexStoreTableId,
2553
+ getMetrics,
2554
+ getPersister,
2555
+ getQueries,
2556
+ getRelationships,
2557
+ getRelationshipsStoreTableIds,
2558
+ getStore,
2559
+ getSynchronizer,
2544
2560
  IndexView,
2545
2561
  LinkedRowsView,
2546
2562
  LocalRowsView,
2547
2563
  MetricView,
2564
+ onCell,
2565
+ onCellIds,
2566
+ onCheckpoint,
2567
+ onCheckpointIds,
2568
+ onDidFinishTransaction,
2569
+ onHasCell,
2570
+ onHasRow,
2571
+ onHasTable,
2572
+ onHasTableCell,
2573
+ onHasTables,
2574
+ onHasValue,
2575
+ onHasValues,
2576
+ onLinkedRowIds,
2577
+ onLocalRowIds,
2578
+ onMetric,
2579
+ onParamValue,
2580
+ onParamValues,
2581
+ onPersisterStatus,
2582
+ onRemoteRowId,
2583
+ onResultCell,
2584
+ onResultCellIds,
2585
+ onResultRow,
2586
+ onResultRowCount,
2587
+ onResultRowIds,
2588
+ onResultSortedRowIds,
2589
+ onResultTable,
2590
+ onResultTableCellIds,
2591
+ onRow,
2592
+ onRowCount,
2593
+ onRowIds,
2594
+ onSliceIds,
2595
+ onSliceRowIds,
2596
+ onSortedRowIds,
2597
+ onStartTransaction,
2598
+ onSynchronizerStatus,
2599
+ onTable,
2600
+ onTableCellIds,
2601
+ onTableIds,
2602
+ onTables,
2603
+ onValue,
2604
+ onValueIds,
2605
+ onValues,
2606
+ onWillFinishTransaction,
2548
2607
  provideCheckpoints,
2549
2608
  provideIndexes,
2550
2609
  provideMetrics,
@@ -2555,6 +2614,14 @@ export {
2555
2614
  provideStore,
2556
2615
  provideSynchronizer,
2557
2616
  RemoteRowView,
2617
+ resolveCheckpoints,
2618
+ resolveIndexes,
2619
+ resolveMetrics,
2620
+ resolvePersister,
2621
+ resolveQueries,
2622
+ resolveRelationships,
2623
+ resolveStore,
2624
+ resolveSynchronizer,
2558
2625
  ResultCellView,
2559
2626
  ResultRowView,
2560
2627
  ResultSortedTableView,
@@ -2564,121 +2631,6 @@ export {
2564
2631
  SortedTableView,
2565
2632
  TablesView,
2566
2633
  TableView,
2567
- useBindableCell,
2568
- useBindableValue,
2569
- useCell,
2570
- useCellIds,
2571
- useCellIdsListener,
2572
- useCellListener,
2573
- useCheckpoint,
2574
- useCheckpointIds,
2575
- useCheckpointIdsListener,
2576
- useCheckpointListener,
2577
- useCheckpoints,
2578
- useCheckpointsIds,
2579
- useCheckpointsOrCheckpointsById,
2580
- useDidFinishTransactionListener,
2581
- useGoBackwardCallback,
2582
- useGoForwardCallback,
2583
- useHasCell,
2584
- useHasCellListener,
2585
- useHasRow,
2586
- useHasRowListener,
2587
- useHasTable,
2588
- useHasTableCell,
2589
- useHasTableCellListener,
2590
- useHasTableListener,
2591
- useHasTables,
2592
- useHasTablesListener,
2593
- useHasValue,
2594
- useHasValueListener,
2595
- useHasValues,
2596
- useHasValuesListener,
2597
- useIndexes,
2598
- useIndexesIds,
2599
- useIndexesOrIndexesById,
2600
- useIndexIds,
2601
- useIndexStoreTableId,
2602
- useLinkedRowIds,
2603
- useLinkedRowIdsListener,
2604
- useLocalRowIds,
2605
- useLocalRowIdsListener,
2606
- useMetric,
2607
- useMetricIds,
2608
- useMetricListener,
2609
- useMetrics,
2610
- useMetricsIds,
2611
- useMetricsOrMetricsById,
2612
- useParamValueListener,
2613
- useParamValuesListener,
2614
- usePersister,
2615
- usePersisterIds,
2616
- usePersisterOrPersisterById,
2617
- usePersisterStatus,
2618
- usePersisterStatusListener,
2619
- useQueries,
2620
- useQueriesIds,
2621
- useQueriesOrQueriesById,
2622
- useQueryIds,
2623
- useRelationshipIds,
2624
- useRelationships,
2625
- useRelationshipsIds,
2626
- useRelationshipsOrRelationshipsById,
2627
- useRelationshipsStoreTableIds,
2628
- useRemoteRowId,
2629
- useRemoteRowIdListener,
2630
- useResultCell,
2631
- useResultCellIds,
2632
- useResultCellIdsListener,
2633
- useResultCellListener,
2634
- useResultRow,
2635
- useResultRowCount,
2636
- useResultRowCountListener,
2637
- useResultRowIds,
2638
- useResultRowIdsListener,
2639
- useResultRowListener,
2640
- useResultSortedRowIds,
2641
- useResultSortedRowIdsListener,
2642
- useResultTable,
2643
- useResultTableCellIds,
2644
- useResultTableCellIdsListener,
2645
- useResultTableListener,
2646
- useRow,
2647
- useRowCount,
2648
- useRowCountListener,
2649
- useRowIds,
2650
- useRowIdsListener,
2651
- useRowListener,
2652
- useSliceIds,
2653
- useSliceIdsListener,
2654
- useSliceRowIds,
2655
- useSliceRowIdsListener,
2656
- useSortedRowIds,
2657
- useSortedRowIdsListener,
2658
- useStartTransactionListener,
2659
- useStore,
2660
- useStoreIds,
2661
- useStoreOrStoreById,
2662
- useSynchronizer,
2663
- useSynchronizerIds,
2664
- useSynchronizerOrSynchronizerById,
2665
- useSynchronizerStatus,
2666
- useSynchronizerStatusListener,
2667
- useTable,
2668
- useTableCellIds,
2669
- useTableCellIdsListener,
2670
- useTableIds,
2671
- useTableIdsListener,
2672
- useTableListener,
2673
- useTables,
2674
- useTablesListener,
2675
- useValue,
2676
- useValueIds,
2677
- useValueIdsListener,
2678
- useValueListener,
2679
- useValues,
2680
- useValuesListener,
2681
- useWillFinishTransactionListener,
2682
2634
  ValuesView,
2683
2635
  ValueView,
2684
2636
  };