@livestore/react 0.3.0-dev.9 → 0.3.1-dev.0

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.
Files changed (97) hide show
  1. package/LICENSE +201 -0
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/LiveStoreContext.d.ts +10 -4
  4. package/dist/LiveStoreContext.d.ts.map +1 -1
  5. package/dist/LiveStoreContext.js +1 -11
  6. package/dist/LiveStoreContext.js.map +1 -1
  7. package/dist/LiveStoreProvider.d.ts +29 -12
  8. package/dist/LiveStoreProvider.d.ts.map +1 -1
  9. package/dist/LiveStoreProvider.js +84 -55
  10. package/dist/LiveStoreProvider.js.map +1 -1
  11. package/dist/LiveStoreProvider.test.js +80 -29
  12. package/dist/LiveStoreProvider.test.js.map +1 -1
  13. package/dist/__tests__/fixture.d.ts +122 -556
  14. package/dist/__tests__/fixture.d.ts.map +1 -1
  15. package/dist/__tests__/fixture.js +71 -30
  16. package/dist/__tests__/fixture.js.map +1 -1
  17. package/dist/experimental/components/LiveList.d.ts +2 -2
  18. package/dist/experimental/components/LiveList.d.ts.map +1 -1
  19. package/dist/experimental/components/LiveList.js +10 -6
  20. package/dist/experimental/components/LiveList.js.map +1 -1
  21. package/dist/mod.d.ts +4 -5
  22. package/dist/mod.d.ts.map +1 -1
  23. package/dist/mod.js +4 -5
  24. package/dist/mod.js.map +1 -1
  25. package/dist/useClientDocument.d.ts +61 -0
  26. package/dist/useClientDocument.d.ts.map +1 -0
  27. package/dist/useClientDocument.js +79 -0
  28. package/dist/useClientDocument.js.map +1 -0
  29. package/dist/useClientDocument.test.d.ts +2 -0
  30. package/dist/useClientDocument.test.d.ts.map +1 -0
  31. package/dist/useClientDocument.test.js +175 -0
  32. package/dist/useClientDocument.test.js.map +1 -0
  33. package/dist/useQuery.d.ts +25 -3
  34. package/dist/useQuery.d.ts.map +1 -1
  35. package/dist/useQuery.js +67 -47
  36. package/dist/useQuery.js.map +1 -1
  37. package/dist/useQuery.test.d.ts +1 -1
  38. package/dist/useQuery.test.d.ts.map +1 -1
  39. package/dist/useQuery.test.js +86 -24
  40. package/dist/useQuery.test.js.map +1 -1
  41. package/dist/useRcResource.d.ts +76 -0
  42. package/dist/useRcResource.d.ts.map +1 -0
  43. package/dist/useRcResource.js +152 -0
  44. package/dist/useRcResource.js.map +1 -0
  45. package/dist/useRcResource.test.d.ts +2 -0
  46. package/dist/useRcResource.test.d.ts.map +1 -0
  47. package/dist/useRcResource.test.js +122 -0
  48. package/dist/useRcResource.test.js.map +1 -0
  49. package/dist/useStore.d.ts +9 -0
  50. package/dist/useStore.d.ts.map +1 -0
  51. package/dist/useStore.js +28 -0
  52. package/dist/useStore.js.map +1 -0
  53. package/dist/utils/useStateRefWithReactiveInput.d.ts.map +1 -1
  54. package/package.json +20 -13
  55. package/src/LiveStoreContext.ts +11 -16
  56. package/src/LiveStoreProvider.test.tsx +176 -37
  57. package/src/LiveStoreProvider.tsx +156 -81
  58. package/src/__snapshots__/useClientDocument.test.tsx.snap +613 -0
  59. package/src/__snapshots__/useQuery.test.tsx.snap +2011 -0
  60. package/src/__tests__/fixture.tsx +74 -47
  61. package/src/experimental/components/LiveList.tsx +10 -7
  62. package/src/mod.ts +5 -6
  63. package/src/useClientDocument.test.tsx +306 -0
  64. package/src/useClientDocument.ts +157 -0
  65. package/src/useQuery.test.tsx +182 -71
  66. package/src/useQuery.ts +95 -58
  67. package/src/useRcResource.test.tsx +167 -0
  68. package/src/useRcResource.ts +182 -0
  69. package/src/useStore.ts +36 -0
  70. package/dist/useAtom.d.ts +0 -5
  71. package/dist/useAtom.d.ts.map +0 -1
  72. package/dist/useAtom.js +0 -38
  73. package/dist/useAtom.js.map +0 -1
  74. package/dist/useRow.d.ts +0 -50
  75. package/dist/useRow.d.ts.map +0 -1
  76. package/dist/useRow.js +0 -93
  77. package/dist/useRow.js.map +0 -1
  78. package/dist/useRow.test.d.ts +0 -2
  79. package/dist/useRow.test.d.ts.map +0 -1
  80. package/dist/useRow.test.js +0 -202
  81. package/dist/useRow.test.js.map +0 -1
  82. package/dist/useScopedQuery.d.ts +0 -33
  83. package/dist/useScopedQuery.d.ts.map +0 -1
  84. package/dist/useScopedQuery.js +0 -87
  85. package/dist/useScopedQuery.js.map +0 -1
  86. package/dist/useScopedQuery.test.d.ts +0 -2
  87. package/dist/useScopedQuery.test.d.ts.map +0 -1
  88. package/dist/useScopedQuery.test.js +0 -60
  89. package/dist/useScopedQuery.test.js.map +0 -1
  90. package/src/__snapshots__/useRow.test.tsx.snap +0 -360
  91. package/src/useAtom.ts +0 -52
  92. package/src/useRow.test.tsx +0 -344
  93. package/src/useRow.ts +0 -188
  94. package/src/useScopedQuery.test.tsx +0 -96
  95. package/src/useScopedQuery.ts +0 -143
  96. package/tsconfig.json +0 -20
  97. package/vitest.config.js +0 -17
@@ -0,0 +1,2011 @@
1
+ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
+
3
+ exports[`useQuery (strictMode={ strictMode: false }) > filtered dependency query 1`] = `
4
+ {
5
+ "atoms": [
6
+ {
7
+ "_tag": "ref",
8
+ "id": "node-1",
9
+ "isDestroyed": false,
10
+ "isDirty": false,
11
+ "label": "tableRef:todos",
12
+ "meta": {
13
+ "liveStoreRefType": "table",
14
+ },
15
+ "previousResult": {
16
+ "_tag": "Some",
17
+ "value": "null",
18
+ },
19
+ "refreshes": 1,
20
+ "sub": [],
21
+ "super": [
22
+ "node-6",
23
+ ],
24
+ },
25
+ {
26
+ "_tag": "ref",
27
+ "id": "node-2",
28
+ "isDestroyed": false,
29
+ "isDirty": false,
30
+ "label": "tableRef:app",
31
+ "meta": {
32
+ "liveStoreRefType": "table",
33
+ },
34
+ "previousResult": {
35
+ "_tag": "Some",
36
+ "value": "null",
37
+ },
38
+ "refreshes": 0,
39
+ "sub": [],
40
+ "super": [],
41
+ },
42
+ {
43
+ "_tag": "ref",
44
+ "id": "node-3",
45
+ "isDestroyed": false,
46
+ "isDirty": false,
47
+ "label": "tableRef:UserInfo",
48
+ "meta": {
49
+ "liveStoreRefType": "table",
50
+ },
51
+ "previousResult": {
52
+ "_tag": "Some",
53
+ "value": "null",
54
+ },
55
+ "refreshes": 0,
56
+ "sub": [],
57
+ "super": [],
58
+ },
59
+ {
60
+ "_tag": "ref",
61
+ "id": "node-4",
62
+ "isDestroyed": false,
63
+ "isDirty": false,
64
+ "label": "tableRef:AppRouter",
65
+ "meta": {
66
+ "liveStoreRefType": "table",
67
+ },
68
+ "previousResult": {
69
+ "_tag": "Some",
70
+ "value": "null",
71
+ },
72
+ "refreshes": 0,
73
+ "sub": [],
74
+ "super": [],
75
+ },
76
+ {
77
+ "_tag": "thunk",
78
+ "id": "node-5",
79
+ "isDestroyed": false,
80
+ "isDirty": false,
81
+ "label": "todo:query",
82
+ "meta": {
83
+ "liveStoreThunkType": "db.query",
84
+ },
85
+ "previousResult": {
86
+ "_tag": "Some",
87
+ "value": "{"query":"SELECT * FROM 'todos' WHERE id = ?","bindValues":["t1"],"queriedTables":{}}",
88
+ },
89
+ "recomputations": 1,
90
+ "sub": [
91
+ "node-7",
92
+ ],
93
+ "super": [
94
+ "node-6",
95
+ ],
96
+ },
97
+ {
98
+ "_tag": "thunk",
99
+ "id": "node-6",
100
+ "isDestroyed": false,
101
+ "isDirty": false,
102
+ "label": "todo:results",
103
+ "meta": {
104
+ "liveStoreThunkType": "db.result",
105
+ },
106
+ "previousResult": {
107
+ "_tag": "Some",
108
+ "value": "[{"id":"t1","text":"buy milk","completed":false}]",
109
+ },
110
+ "recomputations": 1,
111
+ "sub": [
112
+ "node-5",
113
+ "node-1",
114
+ ],
115
+ "super": [
116
+ "node-8",
117
+ ],
118
+ },
119
+ {
120
+ "_tag": "ref",
121
+ "id": "node-7",
122
+ "isDestroyed": false,
123
+ "isDirty": false,
124
+ "label": "id-filter",
125
+ "meta": undefined,
126
+ "previousResult": {
127
+ "_tag": "Some",
128
+ "value": ""t1"",
129
+ },
130
+ "refreshes": 0,
131
+ "sub": [],
132
+ "super": [
133
+ "node-5",
134
+ ],
135
+ },
136
+ ],
137
+ "deferredEffects": [],
138
+ "effects": [
139
+ {
140
+ "_tag": "effect",
141
+ "id": "node-8",
142
+ "invocations": 1,
143
+ "isDestroyed": false,
144
+ "label": "subscribe:SELECT * FROM 'todos' WHERE id = ?",
145
+ "sub": [
146
+ "node-6",
147
+ ],
148
+ },
149
+ ],
150
+ }
151
+ `;
152
+
153
+ exports[`useQuery (strictMode={ strictMode: false }) > filtered dependency query 2`] = `
154
+ {
155
+ "atoms": [
156
+ {
157
+ "_tag": "ref",
158
+ "id": "node-1",
159
+ "isDestroyed": false,
160
+ "isDirty": false,
161
+ "label": "tableRef:todos",
162
+ "meta": {
163
+ "liveStoreRefType": "table",
164
+ },
165
+ "previousResult": {
166
+ "_tag": "Some",
167
+ "value": "null",
168
+ },
169
+ "refreshes": 2,
170
+ "sub": [],
171
+ "super": [
172
+ "node-6",
173
+ ],
174
+ },
175
+ {
176
+ "_tag": "ref",
177
+ "id": "node-2",
178
+ "isDestroyed": false,
179
+ "isDirty": false,
180
+ "label": "tableRef:app",
181
+ "meta": {
182
+ "liveStoreRefType": "table",
183
+ },
184
+ "previousResult": {
185
+ "_tag": "Some",
186
+ "value": "null",
187
+ },
188
+ "refreshes": 0,
189
+ "sub": [],
190
+ "super": [],
191
+ },
192
+ {
193
+ "_tag": "ref",
194
+ "id": "node-3",
195
+ "isDestroyed": false,
196
+ "isDirty": false,
197
+ "label": "tableRef:UserInfo",
198
+ "meta": {
199
+ "liveStoreRefType": "table",
200
+ },
201
+ "previousResult": {
202
+ "_tag": "Some",
203
+ "value": "null",
204
+ },
205
+ "refreshes": 0,
206
+ "sub": [],
207
+ "super": [],
208
+ },
209
+ {
210
+ "_tag": "ref",
211
+ "id": "node-4",
212
+ "isDestroyed": false,
213
+ "isDirty": false,
214
+ "label": "tableRef:AppRouter",
215
+ "meta": {
216
+ "liveStoreRefType": "table",
217
+ },
218
+ "previousResult": {
219
+ "_tag": "Some",
220
+ "value": "null",
221
+ },
222
+ "refreshes": 0,
223
+ "sub": [],
224
+ "super": [],
225
+ },
226
+ {
227
+ "_tag": "thunk",
228
+ "id": "node-5",
229
+ "isDestroyed": false,
230
+ "isDirty": false,
231
+ "label": "todo:query",
232
+ "meta": {
233
+ "liveStoreThunkType": "db.query",
234
+ },
235
+ "previousResult": {
236
+ "_tag": "Some",
237
+ "value": "{"query":"SELECT * FROM 'todos' WHERE id = ?","bindValues":["t1"],"queriedTables":{}}",
238
+ },
239
+ "recomputations": 1,
240
+ "sub": [
241
+ "node-7",
242
+ ],
243
+ "super": [
244
+ "node-6",
245
+ ],
246
+ },
247
+ {
248
+ "_tag": "thunk",
249
+ "id": "node-6",
250
+ "isDestroyed": false,
251
+ "isDirty": false,
252
+ "label": "todo:results",
253
+ "meta": {
254
+ "liveStoreThunkType": "db.result",
255
+ },
256
+ "previousResult": {
257
+ "_tag": "Some",
258
+ "value": "[{"id":"t1","text":"buy soy milk","completed":false}]",
259
+ },
260
+ "recomputations": 2,
261
+ "sub": [
262
+ "node-5",
263
+ "node-1",
264
+ ],
265
+ "super": [
266
+ "node-8",
267
+ ],
268
+ },
269
+ {
270
+ "_tag": "ref",
271
+ "id": "node-7",
272
+ "isDestroyed": false,
273
+ "isDirty": false,
274
+ "label": "id-filter",
275
+ "meta": undefined,
276
+ "previousResult": {
277
+ "_tag": "Some",
278
+ "value": ""t1"",
279
+ },
280
+ "refreshes": 0,
281
+ "sub": [],
282
+ "super": [
283
+ "node-5",
284
+ ],
285
+ },
286
+ ],
287
+ "deferredEffects": [],
288
+ "effects": [
289
+ {
290
+ "_tag": "effect",
291
+ "id": "node-8",
292
+ "invocations": 2,
293
+ "isDestroyed": false,
294
+ "label": "subscribe:SELECT * FROM 'todos' WHERE id = ?",
295
+ "sub": [
296
+ "node-6",
297
+ ],
298
+ },
299
+ ],
300
+ }
301
+ `;
302
+
303
+ exports[`useQuery (strictMode={ strictMode: false }) > filtered dependency query 3`] = `
304
+ {
305
+ "atoms": [
306
+ {
307
+ "_tag": "ref",
308
+ "id": "node-1",
309
+ "isDestroyed": false,
310
+ "isDirty": false,
311
+ "label": "tableRef:todos",
312
+ "meta": {
313
+ "liveStoreRefType": "table",
314
+ },
315
+ "previousResult": {
316
+ "_tag": "Some",
317
+ "value": "null",
318
+ },
319
+ "refreshes": 2,
320
+ "sub": [],
321
+ "super": [
322
+ "node-6",
323
+ ],
324
+ },
325
+ {
326
+ "_tag": "ref",
327
+ "id": "node-2",
328
+ "isDestroyed": false,
329
+ "isDirty": false,
330
+ "label": "tableRef:app",
331
+ "meta": {
332
+ "liveStoreRefType": "table",
333
+ },
334
+ "previousResult": {
335
+ "_tag": "Some",
336
+ "value": "null",
337
+ },
338
+ "refreshes": 0,
339
+ "sub": [],
340
+ "super": [],
341
+ },
342
+ {
343
+ "_tag": "ref",
344
+ "id": "node-3",
345
+ "isDestroyed": false,
346
+ "isDirty": false,
347
+ "label": "tableRef:UserInfo",
348
+ "meta": {
349
+ "liveStoreRefType": "table",
350
+ },
351
+ "previousResult": {
352
+ "_tag": "Some",
353
+ "value": "null",
354
+ },
355
+ "refreshes": 0,
356
+ "sub": [],
357
+ "super": [],
358
+ },
359
+ {
360
+ "_tag": "ref",
361
+ "id": "node-4",
362
+ "isDestroyed": false,
363
+ "isDirty": false,
364
+ "label": "tableRef:AppRouter",
365
+ "meta": {
366
+ "liveStoreRefType": "table",
367
+ },
368
+ "previousResult": {
369
+ "_tag": "Some",
370
+ "value": "null",
371
+ },
372
+ "refreshes": 0,
373
+ "sub": [],
374
+ "super": [],
375
+ },
376
+ {
377
+ "_tag": "thunk",
378
+ "id": "node-5",
379
+ "isDestroyed": false,
380
+ "isDirty": false,
381
+ "label": "todo:query",
382
+ "meta": {
383
+ "liveStoreThunkType": "db.query",
384
+ },
385
+ "previousResult": {
386
+ "_tag": "Some",
387
+ "value": "{"query":"SELECT * FROM 'todos' WHERE id = ?","bindValues":["t2"],"queriedTables":{}}",
388
+ },
389
+ "recomputations": 2,
390
+ "sub": [
391
+ "node-7",
392
+ ],
393
+ "super": [
394
+ "node-6",
395
+ ],
396
+ },
397
+ {
398
+ "_tag": "thunk",
399
+ "id": "node-6",
400
+ "isDestroyed": false,
401
+ "isDirty": false,
402
+ "label": "todo:results",
403
+ "meta": {
404
+ "liveStoreThunkType": "db.result",
405
+ },
406
+ "previousResult": {
407
+ "_tag": "Some",
408
+ "value": "[{"id":"t2","text":"buy eggs","completed":false}]",
409
+ },
410
+ "recomputations": 3,
411
+ "sub": [
412
+ "node-5",
413
+ "node-1",
414
+ ],
415
+ "super": [
416
+ "node-8",
417
+ ],
418
+ },
419
+ {
420
+ "_tag": "ref",
421
+ "id": "node-7",
422
+ "isDestroyed": false,
423
+ "isDirty": false,
424
+ "label": "id-filter",
425
+ "meta": undefined,
426
+ "previousResult": {
427
+ "_tag": "Some",
428
+ "value": ""t2"",
429
+ },
430
+ "refreshes": 1,
431
+ "sub": [],
432
+ "super": [
433
+ "node-5",
434
+ ],
435
+ },
436
+ ],
437
+ "deferredEffects": [],
438
+ "effects": [
439
+ {
440
+ "_tag": "effect",
441
+ "id": "node-8",
442
+ "invocations": 3,
443
+ "isDestroyed": false,
444
+ "label": "subscribe:SELECT * FROM 'todos' WHERE id = ?",
445
+ "sub": [
446
+ "node-6",
447
+ ],
448
+ },
449
+ ],
450
+ }
451
+ `;
452
+
453
+ exports[`useQuery (strictMode={ strictMode: false }) > same \`useQuery\` hook invoked with different queries > 1: after first render 1`] = `
454
+ {
455
+ "atoms": [
456
+ {
457
+ "_tag": "ref",
458
+ "id": "node-1",
459
+ "isDestroyed": false,
460
+ "isDirty": false,
461
+ "label": "tableRef:todos",
462
+ "meta": {
463
+ "liveStoreRefType": "table",
464
+ },
465
+ "previousResult": {
466
+ "_tag": "Some",
467
+ "value": "null",
468
+ },
469
+ "refreshes": 1,
470
+ "sub": [],
471
+ "super": [
472
+ "node-5",
473
+ ],
474
+ },
475
+ {
476
+ "_tag": "ref",
477
+ "id": "node-2",
478
+ "isDestroyed": false,
479
+ "isDirty": false,
480
+ "label": "tableRef:app",
481
+ "meta": {
482
+ "liveStoreRefType": "table",
483
+ },
484
+ "previousResult": {
485
+ "_tag": "Some",
486
+ "value": "null",
487
+ },
488
+ "refreshes": 0,
489
+ "sub": [],
490
+ "super": [],
491
+ },
492
+ {
493
+ "_tag": "ref",
494
+ "id": "node-3",
495
+ "isDestroyed": false,
496
+ "isDirty": false,
497
+ "label": "tableRef:UserInfo",
498
+ "meta": {
499
+ "liveStoreRefType": "table",
500
+ },
501
+ "previousResult": {
502
+ "_tag": "Some",
503
+ "value": "null",
504
+ },
505
+ "refreshes": 0,
506
+ "sub": [],
507
+ "super": [],
508
+ },
509
+ {
510
+ "_tag": "ref",
511
+ "id": "node-4",
512
+ "isDestroyed": false,
513
+ "isDirty": false,
514
+ "label": "tableRef:AppRouter",
515
+ "meta": {
516
+ "liveStoreRefType": "table",
517
+ },
518
+ "previousResult": {
519
+ "_tag": "Some",
520
+ "value": "null",
521
+ },
522
+ "refreshes": 0,
523
+ "sub": [],
524
+ "super": [],
525
+ },
526
+ {
527
+ "_tag": "thunk",
528
+ "id": "node-5",
529
+ "isDestroyed": false,
530
+ "isDirty": false,
531
+ "label": "libraryTracksView1:results",
532
+ "meta": {
533
+ "liveStoreThunkType": "db.result",
534
+ },
535
+ "previousResult": {
536
+ "_tag": "Some",
537
+ "value": "[{"id":"t1","text":"buy milk","completed":false}]",
538
+ },
539
+ "recomputations": 1,
540
+ "sub": [
541
+ "node-1",
542
+ ],
543
+ "super": [
544
+ "node-6",
545
+ ],
546
+ },
547
+ ],
548
+ "deferredEffects": [],
549
+ "effects": [
550
+ {
551
+ "_tag": "effect",
552
+ "id": "node-6",
553
+ "invocations": 1,
554
+ "isDestroyed": false,
555
+ "label": "subscribe:libraryTracksView1",
556
+ "sub": [
557
+ "node-5",
558
+ ],
559
+ },
560
+ ],
561
+ }
562
+ `;
563
+
564
+ exports[`useQuery (strictMode={ strictMode: false }) > same \`useQuery\` hook invoked with different queries > 2: after first commit 1`] = `
565
+ {
566
+ "atoms": [
567
+ {
568
+ "_tag": "ref",
569
+ "id": "node-1",
570
+ "isDestroyed": false,
571
+ "isDirty": false,
572
+ "label": "tableRef:todos",
573
+ "meta": {
574
+ "liveStoreRefType": "table",
575
+ },
576
+ "previousResult": {
577
+ "_tag": "Some",
578
+ "value": "null",
579
+ },
580
+ "refreshes": 2,
581
+ "sub": [],
582
+ "super": [
583
+ "node-5",
584
+ ],
585
+ },
586
+ {
587
+ "_tag": "ref",
588
+ "id": "node-2",
589
+ "isDestroyed": false,
590
+ "isDirty": false,
591
+ "label": "tableRef:app",
592
+ "meta": {
593
+ "liveStoreRefType": "table",
594
+ },
595
+ "previousResult": {
596
+ "_tag": "Some",
597
+ "value": "null",
598
+ },
599
+ "refreshes": 0,
600
+ "sub": [],
601
+ "super": [],
602
+ },
603
+ {
604
+ "_tag": "ref",
605
+ "id": "node-3",
606
+ "isDestroyed": false,
607
+ "isDirty": false,
608
+ "label": "tableRef:UserInfo",
609
+ "meta": {
610
+ "liveStoreRefType": "table",
611
+ },
612
+ "previousResult": {
613
+ "_tag": "Some",
614
+ "value": "null",
615
+ },
616
+ "refreshes": 0,
617
+ "sub": [],
618
+ "super": [],
619
+ },
620
+ {
621
+ "_tag": "ref",
622
+ "id": "node-4",
623
+ "isDestroyed": false,
624
+ "isDirty": false,
625
+ "label": "tableRef:AppRouter",
626
+ "meta": {
627
+ "liveStoreRefType": "table",
628
+ },
629
+ "previousResult": {
630
+ "_tag": "Some",
631
+ "value": "null",
632
+ },
633
+ "refreshes": 0,
634
+ "sub": [],
635
+ "super": [],
636
+ },
637
+ {
638
+ "_tag": "thunk",
639
+ "id": "node-5",
640
+ "isDestroyed": false,
641
+ "isDirty": false,
642
+ "label": "libraryTracksView1:results",
643
+ "meta": {
644
+ "liveStoreThunkType": "db.result",
645
+ },
646
+ "previousResult": {
647
+ "_tag": "Some",
648
+ "value": "[{"id":"t1","text":"buy soy milk","completed":false}]",
649
+ },
650
+ "recomputations": 2,
651
+ "sub": [
652
+ "node-1",
653
+ ],
654
+ "super": [
655
+ "node-6",
656
+ ],
657
+ },
658
+ ],
659
+ "deferredEffects": [],
660
+ "effects": [
661
+ {
662
+ "_tag": "effect",
663
+ "id": "node-6",
664
+ "invocations": 2,
665
+ "isDestroyed": false,
666
+ "label": "subscribe:libraryTracksView1",
667
+ "sub": [
668
+ "node-5",
669
+ ],
670
+ },
671
+ ],
672
+ }
673
+ `;
674
+
675
+ exports[`useQuery (strictMode={ strictMode: false }) > same \`useQuery\` hook invoked with different queries > 3: after forced rerender 1`] = `
676
+ {
677
+ "atoms": [
678
+ {
679
+ "_tag": "ref",
680
+ "id": "node-1",
681
+ "isDestroyed": false,
682
+ "isDirty": false,
683
+ "label": "tableRef:todos",
684
+ "meta": {
685
+ "liveStoreRefType": "table",
686
+ },
687
+ "previousResult": {
688
+ "_tag": "Some",
689
+ "value": "null",
690
+ },
691
+ "refreshes": 2,
692
+ "sub": [],
693
+ "super": [
694
+ "node-7",
695
+ ],
696
+ },
697
+ {
698
+ "_tag": "ref",
699
+ "id": "node-2",
700
+ "isDestroyed": false,
701
+ "isDirty": false,
702
+ "label": "tableRef:app",
703
+ "meta": {
704
+ "liveStoreRefType": "table",
705
+ },
706
+ "previousResult": {
707
+ "_tag": "Some",
708
+ "value": "null",
709
+ },
710
+ "refreshes": 0,
711
+ "sub": [],
712
+ "super": [],
713
+ },
714
+ {
715
+ "_tag": "ref",
716
+ "id": "node-3",
717
+ "isDestroyed": false,
718
+ "isDirty": false,
719
+ "label": "tableRef:UserInfo",
720
+ "meta": {
721
+ "liveStoreRefType": "table",
722
+ },
723
+ "previousResult": {
724
+ "_tag": "Some",
725
+ "value": "null",
726
+ },
727
+ "refreshes": 0,
728
+ "sub": [],
729
+ "super": [],
730
+ },
731
+ {
732
+ "_tag": "ref",
733
+ "id": "node-4",
734
+ "isDestroyed": false,
735
+ "isDirty": false,
736
+ "label": "tableRef:AppRouter",
737
+ "meta": {
738
+ "liveStoreRefType": "table",
739
+ },
740
+ "previousResult": {
741
+ "_tag": "Some",
742
+ "value": "null",
743
+ },
744
+ "refreshes": 0,
745
+ "sub": [],
746
+ "super": [],
747
+ },
748
+ {
749
+ "_tag": "thunk",
750
+ "id": "node-7",
751
+ "isDestroyed": false,
752
+ "isDirty": false,
753
+ "label": "libraryTracksView2:results",
754
+ "meta": {
755
+ "liveStoreThunkType": "db.result",
756
+ },
757
+ "previousResult": {
758
+ "_tag": "Some",
759
+ "value": "[{"id":"t2","text":"buy eggs","completed":false}]",
760
+ },
761
+ "recomputations": 2,
762
+ "sub": [
763
+ "node-1",
764
+ ],
765
+ "super": [
766
+ "node-8",
767
+ ],
768
+ },
769
+ ],
770
+ "deferredEffects": [],
771
+ "effects": [
772
+ {
773
+ "_tag": "effect",
774
+ "id": "node-8",
775
+ "invocations": 1,
776
+ "isDestroyed": false,
777
+ "label": "subscribe:libraryTracksView2",
778
+ "sub": [
779
+ "node-7",
780
+ ],
781
+ },
782
+ ],
783
+ }
784
+ `;
785
+
786
+ exports[`useQuery (strictMode={ strictMode: false }) > simple 1`] = `
787
+ {
788
+ "atoms": [
789
+ {
790
+ "_tag": "ref",
791
+ "id": "node-1",
792
+ "isDestroyed": false,
793
+ "isDirty": false,
794
+ "label": "tableRef:todos",
795
+ "meta": {
796
+ "liveStoreRefType": "table",
797
+ },
798
+ "previousResult": {
799
+ "_tag": "Some",
800
+ "value": "null",
801
+ },
802
+ "refreshes": 0,
803
+ "sub": [],
804
+ "super": [
805
+ "node-5",
806
+ ],
807
+ },
808
+ {
809
+ "_tag": "ref",
810
+ "id": "node-2",
811
+ "isDestroyed": false,
812
+ "isDirty": false,
813
+ "label": "tableRef:app",
814
+ "meta": {
815
+ "liveStoreRefType": "table",
816
+ },
817
+ "previousResult": {
818
+ "_tag": "Some",
819
+ "value": "null",
820
+ },
821
+ "refreshes": 0,
822
+ "sub": [],
823
+ "super": [],
824
+ },
825
+ {
826
+ "_tag": "ref",
827
+ "id": "node-3",
828
+ "isDestroyed": false,
829
+ "isDirty": false,
830
+ "label": "tableRef:UserInfo",
831
+ "meta": {
832
+ "liveStoreRefType": "table",
833
+ },
834
+ "previousResult": {
835
+ "_tag": "Some",
836
+ "value": "null",
837
+ },
838
+ "refreshes": 0,
839
+ "sub": [],
840
+ "super": [],
841
+ },
842
+ {
843
+ "_tag": "ref",
844
+ "id": "node-4",
845
+ "isDestroyed": false,
846
+ "isDirty": false,
847
+ "label": "tableRef:AppRouter",
848
+ "meta": {
849
+ "liveStoreRefType": "table",
850
+ },
851
+ "previousResult": {
852
+ "_tag": "Some",
853
+ "value": "null",
854
+ },
855
+ "refreshes": 0,
856
+ "sub": [],
857
+ "super": [],
858
+ },
859
+ {
860
+ "_tag": "thunk",
861
+ "id": "node-5",
862
+ "isDestroyed": false,
863
+ "isDirty": false,
864
+ "label": "select * from todos:results",
865
+ "meta": {
866
+ "liveStoreThunkType": "db.result",
867
+ },
868
+ "previousResult": {
869
+ "_tag": "Some",
870
+ "value": "[]",
871
+ },
872
+ "recomputations": 1,
873
+ "sub": [
874
+ "node-1",
875
+ ],
876
+ "super": [
877
+ "node-6",
878
+ ],
879
+ },
880
+ ],
881
+ "deferredEffects": [],
882
+ "effects": [
883
+ {
884
+ "_tag": "effect",
885
+ "id": "node-6",
886
+ "invocations": 1,
887
+ "isDestroyed": false,
888
+ "label": "subscribe:select * from todos",
889
+ "sub": [
890
+ "node-5",
891
+ ],
892
+ },
893
+ ],
894
+ }
895
+ `;
896
+
897
+ exports[`useQuery (strictMode={ strictMode: false }) > simple 2`] = `
898
+ {
899
+ "atoms": [
900
+ {
901
+ "_tag": "ref",
902
+ "id": "node-1",
903
+ "isDestroyed": false,
904
+ "isDirty": false,
905
+ "label": "tableRef:todos",
906
+ "meta": {
907
+ "liveStoreRefType": "table",
908
+ },
909
+ "previousResult": {
910
+ "_tag": "Some",
911
+ "value": "null",
912
+ },
913
+ "refreshes": 1,
914
+ "sub": [],
915
+ "super": [
916
+ "node-5",
917
+ ],
918
+ },
919
+ {
920
+ "_tag": "ref",
921
+ "id": "node-2",
922
+ "isDestroyed": false,
923
+ "isDirty": false,
924
+ "label": "tableRef:app",
925
+ "meta": {
926
+ "liveStoreRefType": "table",
927
+ },
928
+ "previousResult": {
929
+ "_tag": "Some",
930
+ "value": "null",
931
+ },
932
+ "refreshes": 0,
933
+ "sub": [],
934
+ "super": [],
935
+ },
936
+ {
937
+ "_tag": "ref",
938
+ "id": "node-3",
939
+ "isDestroyed": false,
940
+ "isDirty": false,
941
+ "label": "tableRef:UserInfo",
942
+ "meta": {
943
+ "liveStoreRefType": "table",
944
+ },
945
+ "previousResult": {
946
+ "_tag": "Some",
947
+ "value": "null",
948
+ },
949
+ "refreshes": 0,
950
+ "sub": [],
951
+ "super": [],
952
+ },
953
+ {
954
+ "_tag": "ref",
955
+ "id": "node-4",
956
+ "isDestroyed": false,
957
+ "isDirty": false,
958
+ "label": "tableRef:AppRouter",
959
+ "meta": {
960
+ "liveStoreRefType": "table",
961
+ },
962
+ "previousResult": {
963
+ "_tag": "Some",
964
+ "value": "null",
965
+ },
966
+ "refreshes": 0,
967
+ "sub": [],
968
+ "super": [],
969
+ },
970
+ {
971
+ "_tag": "thunk",
972
+ "id": "node-5",
973
+ "isDestroyed": false,
974
+ "isDirty": false,
975
+ "label": "select * from todos:results",
976
+ "meta": {
977
+ "liveStoreThunkType": "db.result",
978
+ },
979
+ "previousResult": {
980
+ "_tag": "Some",
981
+ "value": "[{"id":"t1","text":"buy milk","completed":false}]",
982
+ },
983
+ "recomputations": 2,
984
+ "sub": [
985
+ "node-1",
986
+ ],
987
+ "super": [
988
+ "node-6",
989
+ ],
990
+ },
991
+ ],
992
+ "deferredEffects": [],
993
+ "effects": [
994
+ {
995
+ "_tag": "effect",
996
+ "id": "node-6",
997
+ "invocations": 2,
998
+ "isDestroyed": false,
999
+ "label": "subscribe:select * from todos",
1000
+ "sub": [
1001
+ "node-5",
1002
+ ],
1003
+ },
1004
+ ],
1005
+ }
1006
+ `;
1007
+
1008
+ exports[`useQuery (strictMode={ strictMode: true }) > filtered dependency query 1`] = `
1009
+ {
1010
+ "atoms": [
1011
+ {
1012
+ "_tag": "ref",
1013
+ "id": "node-1",
1014
+ "isDestroyed": false,
1015
+ "isDirty": false,
1016
+ "label": "tableRef:todos",
1017
+ "meta": {
1018
+ "liveStoreRefType": "table",
1019
+ },
1020
+ "previousResult": {
1021
+ "_tag": "Some",
1022
+ "value": "null",
1023
+ },
1024
+ "refreshes": 1,
1025
+ "sub": [],
1026
+ "super": [
1027
+ "node-6",
1028
+ ],
1029
+ },
1030
+ {
1031
+ "_tag": "ref",
1032
+ "id": "node-2",
1033
+ "isDestroyed": false,
1034
+ "isDirty": false,
1035
+ "label": "tableRef:app",
1036
+ "meta": {
1037
+ "liveStoreRefType": "table",
1038
+ },
1039
+ "previousResult": {
1040
+ "_tag": "Some",
1041
+ "value": "null",
1042
+ },
1043
+ "refreshes": 0,
1044
+ "sub": [],
1045
+ "super": [],
1046
+ },
1047
+ {
1048
+ "_tag": "ref",
1049
+ "id": "node-3",
1050
+ "isDestroyed": false,
1051
+ "isDirty": false,
1052
+ "label": "tableRef:UserInfo",
1053
+ "meta": {
1054
+ "liveStoreRefType": "table",
1055
+ },
1056
+ "previousResult": {
1057
+ "_tag": "Some",
1058
+ "value": "null",
1059
+ },
1060
+ "refreshes": 0,
1061
+ "sub": [],
1062
+ "super": [],
1063
+ },
1064
+ {
1065
+ "_tag": "ref",
1066
+ "id": "node-4",
1067
+ "isDestroyed": false,
1068
+ "isDirty": false,
1069
+ "label": "tableRef:AppRouter",
1070
+ "meta": {
1071
+ "liveStoreRefType": "table",
1072
+ },
1073
+ "previousResult": {
1074
+ "_tag": "Some",
1075
+ "value": "null",
1076
+ },
1077
+ "refreshes": 0,
1078
+ "sub": [],
1079
+ "super": [],
1080
+ },
1081
+ {
1082
+ "_tag": "thunk",
1083
+ "id": "node-5",
1084
+ "isDestroyed": false,
1085
+ "isDirty": false,
1086
+ "label": "todo:query",
1087
+ "meta": {
1088
+ "liveStoreThunkType": "db.query",
1089
+ },
1090
+ "previousResult": {
1091
+ "_tag": "Some",
1092
+ "value": "{"query":"SELECT * FROM 'todos' WHERE id = ?","bindValues":["t1"],"queriedTables":{}}",
1093
+ },
1094
+ "recomputations": 1,
1095
+ "sub": [
1096
+ "node-7",
1097
+ ],
1098
+ "super": [
1099
+ "node-6",
1100
+ ],
1101
+ },
1102
+ {
1103
+ "_tag": "thunk",
1104
+ "id": "node-6",
1105
+ "isDestroyed": false,
1106
+ "isDirty": false,
1107
+ "label": "todo:results",
1108
+ "meta": {
1109
+ "liveStoreThunkType": "db.result",
1110
+ },
1111
+ "previousResult": {
1112
+ "_tag": "Some",
1113
+ "value": "[{"id":"t1","text":"buy milk","completed":false}]",
1114
+ },
1115
+ "recomputations": 1,
1116
+ "sub": [
1117
+ "node-5",
1118
+ "node-1",
1119
+ ],
1120
+ "super": [
1121
+ "node-8",
1122
+ ],
1123
+ },
1124
+ {
1125
+ "_tag": "ref",
1126
+ "id": "node-7",
1127
+ "isDestroyed": false,
1128
+ "isDirty": false,
1129
+ "label": "id-filter",
1130
+ "meta": undefined,
1131
+ "previousResult": {
1132
+ "_tag": "Some",
1133
+ "value": ""t1"",
1134
+ },
1135
+ "refreshes": 0,
1136
+ "sub": [],
1137
+ "super": [
1138
+ "node-5",
1139
+ ],
1140
+ },
1141
+ ],
1142
+ "deferredEffects": [],
1143
+ "effects": [
1144
+ {
1145
+ "_tag": "effect",
1146
+ "id": "node-8",
1147
+ "invocations": 1,
1148
+ "isDestroyed": false,
1149
+ "label": "subscribe:SELECT * FROM 'todos' WHERE id = ?",
1150
+ "sub": [
1151
+ "node-6",
1152
+ ],
1153
+ },
1154
+ ],
1155
+ }
1156
+ `;
1157
+
1158
+ exports[`useQuery (strictMode={ strictMode: true }) > filtered dependency query 2`] = `
1159
+ {
1160
+ "atoms": [
1161
+ {
1162
+ "_tag": "ref",
1163
+ "id": "node-1",
1164
+ "isDestroyed": false,
1165
+ "isDirty": false,
1166
+ "label": "tableRef:todos",
1167
+ "meta": {
1168
+ "liveStoreRefType": "table",
1169
+ },
1170
+ "previousResult": {
1171
+ "_tag": "Some",
1172
+ "value": "null",
1173
+ },
1174
+ "refreshes": 2,
1175
+ "sub": [],
1176
+ "super": [
1177
+ "node-6",
1178
+ ],
1179
+ },
1180
+ {
1181
+ "_tag": "ref",
1182
+ "id": "node-2",
1183
+ "isDestroyed": false,
1184
+ "isDirty": false,
1185
+ "label": "tableRef:app",
1186
+ "meta": {
1187
+ "liveStoreRefType": "table",
1188
+ },
1189
+ "previousResult": {
1190
+ "_tag": "Some",
1191
+ "value": "null",
1192
+ },
1193
+ "refreshes": 0,
1194
+ "sub": [],
1195
+ "super": [],
1196
+ },
1197
+ {
1198
+ "_tag": "ref",
1199
+ "id": "node-3",
1200
+ "isDestroyed": false,
1201
+ "isDirty": false,
1202
+ "label": "tableRef:UserInfo",
1203
+ "meta": {
1204
+ "liveStoreRefType": "table",
1205
+ },
1206
+ "previousResult": {
1207
+ "_tag": "Some",
1208
+ "value": "null",
1209
+ },
1210
+ "refreshes": 0,
1211
+ "sub": [],
1212
+ "super": [],
1213
+ },
1214
+ {
1215
+ "_tag": "ref",
1216
+ "id": "node-4",
1217
+ "isDestroyed": false,
1218
+ "isDirty": false,
1219
+ "label": "tableRef:AppRouter",
1220
+ "meta": {
1221
+ "liveStoreRefType": "table",
1222
+ },
1223
+ "previousResult": {
1224
+ "_tag": "Some",
1225
+ "value": "null",
1226
+ },
1227
+ "refreshes": 0,
1228
+ "sub": [],
1229
+ "super": [],
1230
+ },
1231
+ {
1232
+ "_tag": "thunk",
1233
+ "id": "node-5",
1234
+ "isDestroyed": false,
1235
+ "isDirty": false,
1236
+ "label": "todo:query",
1237
+ "meta": {
1238
+ "liveStoreThunkType": "db.query",
1239
+ },
1240
+ "previousResult": {
1241
+ "_tag": "Some",
1242
+ "value": "{"query":"SELECT * FROM 'todos' WHERE id = ?","bindValues":["t1"],"queriedTables":{}}",
1243
+ },
1244
+ "recomputations": 1,
1245
+ "sub": [
1246
+ "node-7",
1247
+ ],
1248
+ "super": [
1249
+ "node-6",
1250
+ ],
1251
+ },
1252
+ {
1253
+ "_tag": "thunk",
1254
+ "id": "node-6",
1255
+ "isDestroyed": false,
1256
+ "isDirty": false,
1257
+ "label": "todo:results",
1258
+ "meta": {
1259
+ "liveStoreThunkType": "db.result",
1260
+ },
1261
+ "previousResult": {
1262
+ "_tag": "Some",
1263
+ "value": "[{"id":"t1","text":"buy soy milk","completed":false}]",
1264
+ },
1265
+ "recomputations": 2,
1266
+ "sub": [
1267
+ "node-5",
1268
+ "node-1",
1269
+ ],
1270
+ "super": [
1271
+ "node-8",
1272
+ ],
1273
+ },
1274
+ {
1275
+ "_tag": "ref",
1276
+ "id": "node-7",
1277
+ "isDestroyed": false,
1278
+ "isDirty": false,
1279
+ "label": "id-filter",
1280
+ "meta": undefined,
1281
+ "previousResult": {
1282
+ "_tag": "Some",
1283
+ "value": ""t1"",
1284
+ },
1285
+ "refreshes": 0,
1286
+ "sub": [],
1287
+ "super": [
1288
+ "node-5",
1289
+ ],
1290
+ },
1291
+ ],
1292
+ "deferredEffects": [],
1293
+ "effects": [
1294
+ {
1295
+ "_tag": "effect",
1296
+ "id": "node-8",
1297
+ "invocations": 2,
1298
+ "isDestroyed": false,
1299
+ "label": "subscribe:SELECT * FROM 'todos' WHERE id = ?",
1300
+ "sub": [
1301
+ "node-6",
1302
+ ],
1303
+ },
1304
+ ],
1305
+ }
1306
+ `;
1307
+
1308
+ exports[`useQuery (strictMode={ strictMode: true }) > filtered dependency query 3`] = `
1309
+ {
1310
+ "atoms": [
1311
+ {
1312
+ "_tag": "ref",
1313
+ "id": "node-1",
1314
+ "isDestroyed": false,
1315
+ "isDirty": false,
1316
+ "label": "tableRef:todos",
1317
+ "meta": {
1318
+ "liveStoreRefType": "table",
1319
+ },
1320
+ "previousResult": {
1321
+ "_tag": "Some",
1322
+ "value": "null",
1323
+ },
1324
+ "refreshes": 2,
1325
+ "sub": [],
1326
+ "super": [
1327
+ "node-6",
1328
+ ],
1329
+ },
1330
+ {
1331
+ "_tag": "ref",
1332
+ "id": "node-2",
1333
+ "isDestroyed": false,
1334
+ "isDirty": false,
1335
+ "label": "tableRef:app",
1336
+ "meta": {
1337
+ "liveStoreRefType": "table",
1338
+ },
1339
+ "previousResult": {
1340
+ "_tag": "Some",
1341
+ "value": "null",
1342
+ },
1343
+ "refreshes": 0,
1344
+ "sub": [],
1345
+ "super": [],
1346
+ },
1347
+ {
1348
+ "_tag": "ref",
1349
+ "id": "node-3",
1350
+ "isDestroyed": false,
1351
+ "isDirty": false,
1352
+ "label": "tableRef:UserInfo",
1353
+ "meta": {
1354
+ "liveStoreRefType": "table",
1355
+ },
1356
+ "previousResult": {
1357
+ "_tag": "Some",
1358
+ "value": "null",
1359
+ },
1360
+ "refreshes": 0,
1361
+ "sub": [],
1362
+ "super": [],
1363
+ },
1364
+ {
1365
+ "_tag": "ref",
1366
+ "id": "node-4",
1367
+ "isDestroyed": false,
1368
+ "isDirty": false,
1369
+ "label": "tableRef:AppRouter",
1370
+ "meta": {
1371
+ "liveStoreRefType": "table",
1372
+ },
1373
+ "previousResult": {
1374
+ "_tag": "Some",
1375
+ "value": "null",
1376
+ },
1377
+ "refreshes": 0,
1378
+ "sub": [],
1379
+ "super": [],
1380
+ },
1381
+ {
1382
+ "_tag": "thunk",
1383
+ "id": "node-5",
1384
+ "isDestroyed": false,
1385
+ "isDirty": false,
1386
+ "label": "todo:query",
1387
+ "meta": {
1388
+ "liveStoreThunkType": "db.query",
1389
+ },
1390
+ "previousResult": {
1391
+ "_tag": "Some",
1392
+ "value": "{"query":"SELECT * FROM 'todos' WHERE id = ?","bindValues":["t2"],"queriedTables":{}}",
1393
+ },
1394
+ "recomputations": 2,
1395
+ "sub": [
1396
+ "node-7",
1397
+ ],
1398
+ "super": [
1399
+ "node-6",
1400
+ ],
1401
+ },
1402
+ {
1403
+ "_tag": "thunk",
1404
+ "id": "node-6",
1405
+ "isDestroyed": false,
1406
+ "isDirty": false,
1407
+ "label": "todo:results",
1408
+ "meta": {
1409
+ "liveStoreThunkType": "db.result",
1410
+ },
1411
+ "previousResult": {
1412
+ "_tag": "Some",
1413
+ "value": "[{"id":"t2","text":"buy eggs","completed":false}]",
1414
+ },
1415
+ "recomputations": 3,
1416
+ "sub": [
1417
+ "node-5",
1418
+ "node-1",
1419
+ ],
1420
+ "super": [
1421
+ "node-8",
1422
+ ],
1423
+ },
1424
+ {
1425
+ "_tag": "ref",
1426
+ "id": "node-7",
1427
+ "isDestroyed": false,
1428
+ "isDirty": false,
1429
+ "label": "id-filter",
1430
+ "meta": undefined,
1431
+ "previousResult": {
1432
+ "_tag": "Some",
1433
+ "value": ""t2"",
1434
+ },
1435
+ "refreshes": 1,
1436
+ "sub": [],
1437
+ "super": [
1438
+ "node-5",
1439
+ ],
1440
+ },
1441
+ ],
1442
+ "deferredEffects": [],
1443
+ "effects": [
1444
+ {
1445
+ "_tag": "effect",
1446
+ "id": "node-8",
1447
+ "invocations": 3,
1448
+ "isDestroyed": false,
1449
+ "label": "subscribe:SELECT * FROM 'todos' WHERE id = ?",
1450
+ "sub": [
1451
+ "node-6",
1452
+ ],
1453
+ },
1454
+ ],
1455
+ }
1456
+ `;
1457
+
1458
+ exports[`useQuery (strictMode={ strictMode: true }) > same \`useQuery\` hook invoked with different queries > 1: after first render 1`] = `
1459
+ {
1460
+ "atoms": [
1461
+ {
1462
+ "_tag": "ref",
1463
+ "id": "node-1",
1464
+ "isDestroyed": false,
1465
+ "isDirty": false,
1466
+ "label": "tableRef:todos",
1467
+ "meta": {
1468
+ "liveStoreRefType": "table",
1469
+ },
1470
+ "previousResult": {
1471
+ "_tag": "Some",
1472
+ "value": "null",
1473
+ },
1474
+ "refreshes": 1,
1475
+ "sub": [],
1476
+ "super": [
1477
+ "node-5",
1478
+ ],
1479
+ },
1480
+ {
1481
+ "_tag": "ref",
1482
+ "id": "node-2",
1483
+ "isDestroyed": false,
1484
+ "isDirty": false,
1485
+ "label": "tableRef:app",
1486
+ "meta": {
1487
+ "liveStoreRefType": "table",
1488
+ },
1489
+ "previousResult": {
1490
+ "_tag": "Some",
1491
+ "value": "null",
1492
+ },
1493
+ "refreshes": 0,
1494
+ "sub": [],
1495
+ "super": [],
1496
+ },
1497
+ {
1498
+ "_tag": "ref",
1499
+ "id": "node-3",
1500
+ "isDestroyed": false,
1501
+ "isDirty": false,
1502
+ "label": "tableRef:UserInfo",
1503
+ "meta": {
1504
+ "liveStoreRefType": "table",
1505
+ },
1506
+ "previousResult": {
1507
+ "_tag": "Some",
1508
+ "value": "null",
1509
+ },
1510
+ "refreshes": 0,
1511
+ "sub": [],
1512
+ "super": [],
1513
+ },
1514
+ {
1515
+ "_tag": "ref",
1516
+ "id": "node-4",
1517
+ "isDestroyed": false,
1518
+ "isDirty": false,
1519
+ "label": "tableRef:AppRouter",
1520
+ "meta": {
1521
+ "liveStoreRefType": "table",
1522
+ },
1523
+ "previousResult": {
1524
+ "_tag": "Some",
1525
+ "value": "null",
1526
+ },
1527
+ "refreshes": 0,
1528
+ "sub": [],
1529
+ "super": [],
1530
+ },
1531
+ {
1532
+ "_tag": "thunk",
1533
+ "id": "node-5",
1534
+ "isDestroyed": false,
1535
+ "isDirty": false,
1536
+ "label": "libraryTracksView1:results",
1537
+ "meta": {
1538
+ "liveStoreThunkType": "db.result",
1539
+ },
1540
+ "previousResult": {
1541
+ "_tag": "Some",
1542
+ "value": "[{"id":"t1","text":"buy milk","completed":false}]",
1543
+ },
1544
+ "recomputations": 1,
1545
+ "sub": [
1546
+ "node-1",
1547
+ ],
1548
+ "super": [
1549
+ "node-6",
1550
+ ],
1551
+ },
1552
+ ],
1553
+ "deferredEffects": [],
1554
+ "effects": [
1555
+ {
1556
+ "_tag": "effect",
1557
+ "id": "node-6",
1558
+ "invocations": 1,
1559
+ "isDestroyed": false,
1560
+ "label": "subscribe:libraryTracksView1",
1561
+ "sub": [
1562
+ "node-5",
1563
+ ],
1564
+ },
1565
+ ],
1566
+ }
1567
+ `;
1568
+
1569
+ exports[`useQuery (strictMode={ strictMode: true }) > same \`useQuery\` hook invoked with different queries > 2: after first commit 1`] = `
1570
+ {
1571
+ "atoms": [
1572
+ {
1573
+ "_tag": "ref",
1574
+ "id": "node-1",
1575
+ "isDestroyed": false,
1576
+ "isDirty": false,
1577
+ "label": "tableRef:todos",
1578
+ "meta": {
1579
+ "liveStoreRefType": "table",
1580
+ },
1581
+ "previousResult": {
1582
+ "_tag": "Some",
1583
+ "value": "null",
1584
+ },
1585
+ "refreshes": 2,
1586
+ "sub": [],
1587
+ "super": [
1588
+ "node-5",
1589
+ ],
1590
+ },
1591
+ {
1592
+ "_tag": "ref",
1593
+ "id": "node-2",
1594
+ "isDestroyed": false,
1595
+ "isDirty": false,
1596
+ "label": "tableRef:app",
1597
+ "meta": {
1598
+ "liveStoreRefType": "table",
1599
+ },
1600
+ "previousResult": {
1601
+ "_tag": "Some",
1602
+ "value": "null",
1603
+ },
1604
+ "refreshes": 0,
1605
+ "sub": [],
1606
+ "super": [],
1607
+ },
1608
+ {
1609
+ "_tag": "ref",
1610
+ "id": "node-3",
1611
+ "isDestroyed": false,
1612
+ "isDirty": false,
1613
+ "label": "tableRef:UserInfo",
1614
+ "meta": {
1615
+ "liveStoreRefType": "table",
1616
+ },
1617
+ "previousResult": {
1618
+ "_tag": "Some",
1619
+ "value": "null",
1620
+ },
1621
+ "refreshes": 0,
1622
+ "sub": [],
1623
+ "super": [],
1624
+ },
1625
+ {
1626
+ "_tag": "ref",
1627
+ "id": "node-4",
1628
+ "isDestroyed": false,
1629
+ "isDirty": false,
1630
+ "label": "tableRef:AppRouter",
1631
+ "meta": {
1632
+ "liveStoreRefType": "table",
1633
+ },
1634
+ "previousResult": {
1635
+ "_tag": "Some",
1636
+ "value": "null",
1637
+ },
1638
+ "refreshes": 0,
1639
+ "sub": [],
1640
+ "super": [],
1641
+ },
1642
+ {
1643
+ "_tag": "thunk",
1644
+ "id": "node-5",
1645
+ "isDestroyed": false,
1646
+ "isDirty": false,
1647
+ "label": "libraryTracksView1:results",
1648
+ "meta": {
1649
+ "liveStoreThunkType": "db.result",
1650
+ },
1651
+ "previousResult": {
1652
+ "_tag": "Some",
1653
+ "value": "[{"id":"t1","text":"buy soy milk","completed":false}]",
1654
+ },
1655
+ "recomputations": 2,
1656
+ "sub": [
1657
+ "node-1",
1658
+ ],
1659
+ "super": [
1660
+ "node-6",
1661
+ ],
1662
+ },
1663
+ ],
1664
+ "deferredEffects": [],
1665
+ "effects": [
1666
+ {
1667
+ "_tag": "effect",
1668
+ "id": "node-6",
1669
+ "invocations": 2,
1670
+ "isDestroyed": false,
1671
+ "label": "subscribe:libraryTracksView1",
1672
+ "sub": [
1673
+ "node-5",
1674
+ ],
1675
+ },
1676
+ ],
1677
+ }
1678
+ `;
1679
+
1680
+ exports[`useQuery (strictMode={ strictMode: true }) > same \`useQuery\` hook invoked with different queries > 3: after forced rerender 1`] = `
1681
+ {
1682
+ "atoms": [
1683
+ {
1684
+ "_tag": "ref",
1685
+ "id": "node-1",
1686
+ "isDestroyed": false,
1687
+ "isDirty": false,
1688
+ "label": "tableRef:todos",
1689
+ "meta": {
1690
+ "liveStoreRefType": "table",
1691
+ },
1692
+ "previousResult": {
1693
+ "_tag": "Some",
1694
+ "value": "null",
1695
+ },
1696
+ "refreshes": 2,
1697
+ "sub": [],
1698
+ "super": [
1699
+ "node-7",
1700
+ ],
1701
+ },
1702
+ {
1703
+ "_tag": "ref",
1704
+ "id": "node-2",
1705
+ "isDestroyed": false,
1706
+ "isDirty": false,
1707
+ "label": "tableRef:app",
1708
+ "meta": {
1709
+ "liveStoreRefType": "table",
1710
+ },
1711
+ "previousResult": {
1712
+ "_tag": "Some",
1713
+ "value": "null",
1714
+ },
1715
+ "refreshes": 0,
1716
+ "sub": [],
1717
+ "super": [],
1718
+ },
1719
+ {
1720
+ "_tag": "ref",
1721
+ "id": "node-3",
1722
+ "isDestroyed": false,
1723
+ "isDirty": false,
1724
+ "label": "tableRef:UserInfo",
1725
+ "meta": {
1726
+ "liveStoreRefType": "table",
1727
+ },
1728
+ "previousResult": {
1729
+ "_tag": "Some",
1730
+ "value": "null",
1731
+ },
1732
+ "refreshes": 0,
1733
+ "sub": [],
1734
+ "super": [],
1735
+ },
1736
+ {
1737
+ "_tag": "ref",
1738
+ "id": "node-4",
1739
+ "isDestroyed": false,
1740
+ "isDirty": false,
1741
+ "label": "tableRef:AppRouter",
1742
+ "meta": {
1743
+ "liveStoreRefType": "table",
1744
+ },
1745
+ "previousResult": {
1746
+ "_tag": "Some",
1747
+ "value": "null",
1748
+ },
1749
+ "refreshes": 0,
1750
+ "sub": [],
1751
+ "super": [],
1752
+ },
1753
+ {
1754
+ "_tag": "thunk",
1755
+ "id": "node-7",
1756
+ "isDestroyed": false,
1757
+ "isDirty": false,
1758
+ "label": "libraryTracksView2:results",
1759
+ "meta": {
1760
+ "liveStoreThunkType": "db.result",
1761
+ },
1762
+ "previousResult": {
1763
+ "_tag": "Some",
1764
+ "value": "[{"id":"t2","text":"buy eggs","completed":false}]",
1765
+ },
1766
+ "recomputations": 2,
1767
+ "sub": [
1768
+ "node-1",
1769
+ ],
1770
+ "super": [
1771
+ "node-8",
1772
+ ],
1773
+ },
1774
+ ],
1775
+ "deferredEffects": [],
1776
+ "effects": [
1777
+ {
1778
+ "_tag": "effect",
1779
+ "id": "node-8",
1780
+ "invocations": 1,
1781
+ "isDestroyed": false,
1782
+ "label": "subscribe:libraryTracksView2",
1783
+ "sub": [
1784
+ "node-7",
1785
+ ],
1786
+ },
1787
+ ],
1788
+ }
1789
+ `;
1790
+
1791
+ exports[`useQuery (strictMode={ strictMode: true }) > simple 1`] = `
1792
+ {
1793
+ "atoms": [
1794
+ {
1795
+ "_tag": "ref",
1796
+ "id": "node-1",
1797
+ "isDestroyed": false,
1798
+ "isDirty": false,
1799
+ "label": "tableRef:todos",
1800
+ "meta": {
1801
+ "liveStoreRefType": "table",
1802
+ },
1803
+ "previousResult": {
1804
+ "_tag": "Some",
1805
+ "value": "null",
1806
+ },
1807
+ "refreshes": 0,
1808
+ "sub": [],
1809
+ "super": [
1810
+ "node-5",
1811
+ ],
1812
+ },
1813
+ {
1814
+ "_tag": "ref",
1815
+ "id": "node-2",
1816
+ "isDestroyed": false,
1817
+ "isDirty": false,
1818
+ "label": "tableRef:app",
1819
+ "meta": {
1820
+ "liveStoreRefType": "table",
1821
+ },
1822
+ "previousResult": {
1823
+ "_tag": "Some",
1824
+ "value": "null",
1825
+ },
1826
+ "refreshes": 0,
1827
+ "sub": [],
1828
+ "super": [],
1829
+ },
1830
+ {
1831
+ "_tag": "ref",
1832
+ "id": "node-3",
1833
+ "isDestroyed": false,
1834
+ "isDirty": false,
1835
+ "label": "tableRef:UserInfo",
1836
+ "meta": {
1837
+ "liveStoreRefType": "table",
1838
+ },
1839
+ "previousResult": {
1840
+ "_tag": "Some",
1841
+ "value": "null",
1842
+ },
1843
+ "refreshes": 0,
1844
+ "sub": [],
1845
+ "super": [],
1846
+ },
1847
+ {
1848
+ "_tag": "ref",
1849
+ "id": "node-4",
1850
+ "isDestroyed": false,
1851
+ "isDirty": false,
1852
+ "label": "tableRef:AppRouter",
1853
+ "meta": {
1854
+ "liveStoreRefType": "table",
1855
+ },
1856
+ "previousResult": {
1857
+ "_tag": "Some",
1858
+ "value": "null",
1859
+ },
1860
+ "refreshes": 0,
1861
+ "sub": [],
1862
+ "super": [],
1863
+ },
1864
+ {
1865
+ "_tag": "thunk",
1866
+ "id": "node-5",
1867
+ "isDestroyed": false,
1868
+ "isDirty": false,
1869
+ "label": "select * from todos:results",
1870
+ "meta": {
1871
+ "liveStoreThunkType": "db.result",
1872
+ },
1873
+ "previousResult": {
1874
+ "_tag": "Some",
1875
+ "value": "[]",
1876
+ },
1877
+ "recomputations": 1,
1878
+ "sub": [
1879
+ "node-1",
1880
+ ],
1881
+ "super": [
1882
+ "node-6",
1883
+ ],
1884
+ },
1885
+ ],
1886
+ "deferredEffects": [],
1887
+ "effects": [
1888
+ {
1889
+ "_tag": "effect",
1890
+ "id": "node-6",
1891
+ "invocations": 1,
1892
+ "isDestroyed": false,
1893
+ "label": "subscribe:select * from todos",
1894
+ "sub": [
1895
+ "node-5",
1896
+ ],
1897
+ },
1898
+ ],
1899
+ }
1900
+ `;
1901
+
1902
+ exports[`useQuery (strictMode={ strictMode: true }) > simple 2`] = `
1903
+ {
1904
+ "atoms": [
1905
+ {
1906
+ "_tag": "ref",
1907
+ "id": "node-1",
1908
+ "isDestroyed": false,
1909
+ "isDirty": false,
1910
+ "label": "tableRef:todos",
1911
+ "meta": {
1912
+ "liveStoreRefType": "table",
1913
+ },
1914
+ "previousResult": {
1915
+ "_tag": "Some",
1916
+ "value": "null",
1917
+ },
1918
+ "refreshes": 1,
1919
+ "sub": [],
1920
+ "super": [
1921
+ "node-5",
1922
+ ],
1923
+ },
1924
+ {
1925
+ "_tag": "ref",
1926
+ "id": "node-2",
1927
+ "isDestroyed": false,
1928
+ "isDirty": false,
1929
+ "label": "tableRef:app",
1930
+ "meta": {
1931
+ "liveStoreRefType": "table",
1932
+ },
1933
+ "previousResult": {
1934
+ "_tag": "Some",
1935
+ "value": "null",
1936
+ },
1937
+ "refreshes": 0,
1938
+ "sub": [],
1939
+ "super": [],
1940
+ },
1941
+ {
1942
+ "_tag": "ref",
1943
+ "id": "node-3",
1944
+ "isDestroyed": false,
1945
+ "isDirty": false,
1946
+ "label": "tableRef:UserInfo",
1947
+ "meta": {
1948
+ "liveStoreRefType": "table",
1949
+ },
1950
+ "previousResult": {
1951
+ "_tag": "Some",
1952
+ "value": "null",
1953
+ },
1954
+ "refreshes": 0,
1955
+ "sub": [],
1956
+ "super": [],
1957
+ },
1958
+ {
1959
+ "_tag": "ref",
1960
+ "id": "node-4",
1961
+ "isDestroyed": false,
1962
+ "isDirty": false,
1963
+ "label": "tableRef:AppRouter",
1964
+ "meta": {
1965
+ "liveStoreRefType": "table",
1966
+ },
1967
+ "previousResult": {
1968
+ "_tag": "Some",
1969
+ "value": "null",
1970
+ },
1971
+ "refreshes": 0,
1972
+ "sub": [],
1973
+ "super": [],
1974
+ },
1975
+ {
1976
+ "_tag": "thunk",
1977
+ "id": "node-5",
1978
+ "isDestroyed": false,
1979
+ "isDirty": false,
1980
+ "label": "select * from todos:results",
1981
+ "meta": {
1982
+ "liveStoreThunkType": "db.result",
1983
+ },
1984
+ "previousResult": {
1985
+ "_tag": "Some",
1986
+ "value": "[{"id":"t1","text":"buy milk","completed":false}]",
1987
+ },
1988
+ "recomputations": 2,
1989
+ "sub": [
1990
+ "node-1",
1991
+ ],
1992
+ "super": [
1993
+ "node-6",
1994
+ ],
1995
+ },
1996
+ ],
1997
+ "deferredEffects": [],
1998
+ "effects": [
1999
+ {
2000
+ "_tag": "effect",
2001
+ "id": "node-6",
2002
+ "invocations": 2,
2003
+ "isDestroyed": false,
2004
+ "label": "subscribe:select * from todos",
2005
+ "sub": [
2006
+ "node-5",
2007
+ ],
2008
+ },
2009
+ ],
2010
+ }
2011
+ `;