@livestore/react 0.3.0-dev.11 → 0.3.0-dev.5

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 (80) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/LiveStoreContext.d.ts +3 -5
  3. package/dist/LiveStoreContext.d.ts.map +1 -1
  4. package/dist/LiveStoreContext.js +3 -7
  5. package/dist/LiveStoreContext.js.map +1 -1
  6. package/dist/LiveStoreProvider.d.ts +1 -2
  7. package/dist/LiveStoreProvider.d.ts.map +1 -1
  8. package/dist/LiveStoreProvider.js +20 -5
  9. package/dist/LiveStoreProvider.js.map +1 -1
  10. package/dist/__tests__/fixture.d.ts +9 -6
  11. package/dist/__tests__/fixture.d.ts.map +1 -1
  12. package/dist/__tests__/fixture.js +7 -6
  13. package/dist/__tests__/fixture.js.map +1 -1
  14. package/dist/experimental/components/LiveList.d.ts +2 -2
  15. package/dist/experimental/components/LiveList.d.ts.map +1 -1
  16. package/dist/experimental/components/LiveList.js +4 -5
  17. package/dist/experimental/components/LiveList.js.map +1 -1
  18. package/dist/mod.d.ts +1 -0
  19. package/dist/mod.d.ts.map +1 -1
  20. package/dist/mod.js +1 -0
  21. package/dist/mod.js.map +1 -1
  22. package/dist/useAtom.d.ts +2 -4
  23. package/dist/useAtom.d.ts.map +1 -1
  24. package/dist/useAtom.js +28 -32
  25. package/dist/useAtom.js.map +1 -1
  26. package/dist/useQuery.d.ts +3 -26
  27. package/dist/useQuery.d.ts.map +1 -1
  28. package/dist/useQuery.js +45 -60
  29. package/dist/useQuery.js.map +1 -1
  30. package/dist/useQuery.test.js +16 -70
  31. package/dist/useQuery.test.js.map +1 -1
  32. package/dist/useRow.d.ts +7 -10
  33. package/dist/useRow.d.ts.map +1 -1
  34. package/dist/useRow.js +19 -16
  35. package/dist/useRow.js.map +1 -1
  36. package/dist/useRow.test.js +96 -74
  37. package/dist/useRow.test.js.map +1 -1
  38. package/dist/useScopedQuery.d.ts +4 -10
  39. package/dist/useScopedQuery.d.ts.map +1 -1
  40. package/dist/useScopedQuery.js +52 -97
  41. package/dist/useScopedQuery.js.map +1 -1
  42. package/dist/useScopedQuery.test.js +12 -13
  43. package/dist/useScopedQuery.test.js.map +1 -1
  44. package/dist/utils/useStateRefWithReactiveInput.d.ts +1 -1
  45. package/dist/utils/useStateRefWithReactiveInput.d.ts.map +1 -1
  46. package/dist/utils/useStateRefWithReactiveInput.js.map +1 -1
  47. package/package.json +17 -18
  48. package/src/LiveStoreContext.ts +6 -10
  49. package/src/LiveStoreProvider.tsx +21 -7
  50. package/src/__snapshots__/useRow.test.tsx.snap +149 -337
  51. package/src/__tests__/fixture.tsx +10 -7
  52. package/src/experimental/components/LiveList.tsx +7 -8
  53. package/src/mod.ts +1 -0
  54. package/src/useAtom.ts +11 -22
  55. package/src/useQuery.test.tsx +67 -165
  56. package/src/useQuery.ts +54 -84
  57. package/src/useRow.test.tsx +163 -130
  58. package/src/useRow.ts +35 -32
  59. package/src/useScopedQuery.test.tsx +96 -0
  60. package/src/useScopedQuery.ts +142 -0
  61. package/src/utils/useStateRefWithReactiveInput.ts +1 -1
  62. package/dist/useRcRef.d.ts +0 -72
  63. package/dist/useRcRef.d.ts.map +0 -1
  64. package/dist/useRcRef.js +0 -146
  65. package/dist/useRcRef.js.map +0 -1
  66. package/dist/useRcRef.test.d.ts +0 -2
  67. package/dist/useRcRef.test.d.ts.map +0 -1
  68. package/dist/useRcRef.test.js +0 -128
  69. package/dist/useRcRef.test.js.map +0 -1
  70. package/dist/useRcResource.d.ts +0 -76
  71. package/dist/useRcResource.d.ts.map +0 -1
  72. package/dist/useRcResource.js +0 -150
  73. package/dist/useRcResource.js.map +0 -1
  74. package/dist/useRcResource.test.d.ts +0 -2
  75. package/dist/useRcResource.test.d.ts.map +0 -1
  76. package/dist/useRcResource.test.js +0 -122
  77. package/dist/useRcResource.test.js.map +0 -1
  78. package/src/__snapshots__/useQuery.test.tsx.snap +0 -2011
  79. package/src/useRcResource.test.tsx +0 -167
  80. package/src/useRcResource.ts +0 -180
@@ -1,6 +1,6 @@
1
1
  // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
2
 
3
- exports[`useRow > otel > should update the data based on component key strictMode={ strictMode: false } 1`] = `
3
+ exports[`useRow > otel > should update the data based on component key > strictMode=false 1`] = `
4
4
  {
5
5
  "_name": "createStore",
6
6
  "attributes": {
@@ -21,6 +21,25 @@ exports[`useRow > otel > should update the data based on component key strictMod
21
21
  ",
22
22
  },
23
23
  },
24
+ {
25
+ "_name": "LiveStore:createStore",
26
+ },
27
+ {
28
+ "_name": "sql-in-memory-select",
29
+ "attributes": {
30
+ "sql.cached": false,
31
+ "sql.query": "SELECT 1 FROM 'UserInfo' WHERE id = ?",
32
+ "sql.rowsCount": 0,
33
+ },
34
+ },
35
+ {
36
+ "_name": "sql-in-memory-select",
37
+ "attributes": {
38
+ "sql.cached": false,
39
+ "sql.query": "SELECT 1 FROM 'UserInfo' WHERE id = ?",
40
+ "sql.rowsCount": 1,
41
+ },
42
+ },
24
43
  {
25
44
  "_name": "LiveStore:sync",
26
45
  },
@@ -30,17 +49,22 @@ exports[`useRow > otel > should update the data based on component key strictMod
30
49
  {
31
50
  "_name": "LiveStore:mutate",
32
51
  "attributes": {
33
- "livestore.mutationEventTags": [
34
- "_Derived_Create_UserInfo",
35
- ],
36
- "livestore.mutationEventsCount": 1,
52
+ "livestore.mutateLabel": "mutate",
37
53
  },
38
54
  "children": [
39
55
  {
40
- "_name": "livestore.in-memory-db:execute",
56
+ "_name": "LiveStore:mutate:applyMutations",
41
57
  "attributes": {
42
- "sql.query": "INSERT INTO UserInfo (username, text, id) VALUES ($username, $text, $id)",
58
+ "livestore.mutateLabel": "mutate",
43
59
  },
60
+ "children": [
61
+ {
62
+ "_name": "livestore.in-memory-db:execute",
63
+ "attributes": {
64
+ "sql.query": "INSERT INTO UserInfo (id, username) VALUES ('u2', 'username_u2')",
65
+ },
66
+ },
67
+ ],
44
68
  },
45
69
  ],
46
70
  },
@@ -50,67 +74,60 @@ exports[`useRow > otel > should update the data based on component key strictMod
50
74
  "_name": "LiveStore:queries",
51
75
  "children": [
52
76
  {
53
- "_name": "LiveStore:useRow:UserInfo:u1",
77
+ "_name": "db:SELECT * FROM 'UserInfo' WHERE id = ?",
54
78
  "attributes": {
55
- "firstStackInfo": "{"frames":[{"name":"renderHook.wrapper","filePath":"__REPLACED_FOR_SNAPSHOT__"},{"name":"useRow","filePath":"__REPLACED_FOR_SNAPSHOT__"}]}",
56
- "label": "SELECT * FROM 'UserInfo' WHERE id = ?",
79
+ "sql.query": "SELECT * FROM 'UserInfo' WHERE id = ?",
80
+ "sql.rowsCount": 1,
57
81
  },
58
82
  "children": [
59
83
  {
60
84
  "_name": "sql-in-memory-select",
61
85
  "attributes": {
62
86
  "sql.cached": false,
63
- "sql.query": "SELECT 1 FROM 'UserInfo' WHERE id = ?",
64
- "sql.rowsCount": 0,
87
+ "sql.query": "SELECT * FROM 'UserInfo' WHERE id = ?",
88
+ "sql.rowsCount": 1,
65
89
  },
66
90
  },
91
+ ],
92
+ },
93
+ {
94
+ "_name": "LiveStore:useRow:UserInfo:u1",
95
+ "attributes": {
96
+ "id": "u1",
97
+ },
98
+ "children": [
67
99
  {
68
100
  "_name": "LiveStore:mutate",
69
101
  "attributes": {
70
- "livestore.mutateLabel": "rowQuery:UserInfo:u1",
71
- "livestore.mutationEventTags": [
72
- "_Derived_Create_UserInfo",
73
- ],
74
- "livestore.mutationEventsCount": 1,
102
+ "livestore.mutateLabel": "mutate",
75
103
  },
76
104
  "children": [
77
105
  {
78
- "_name": "livestore.in-memory-db:execute",
106
+ "_name": "LiveStore:mutate:applyMutations",
79
107
  "attributes": {
80
- "sql.query": "INSERT INTO UserInfo (username, text, id) VALUES ($username, $text, $id)",
81
- },
82
- },
83
- ],
84
- },
85
- {
86
- "_name": "db:SELECT * FROM 'UserInfo' WHERE id = ?",
87
- "attributes": {
88
- "livestore.debugRefreshReason": "useQuery:initial-run:row:UserInfo:u1",
89
- "sql.query": "SELECT * FROM 'UserInfo' WHERE id = ?",
90
- "sql.rowsCount": 1,
91
- },
92
- "children": [
93
- {
94
- "_name": "sql-in-memory-select",
95
- "attributes": {
96
- "sql.cached": false,
97
- "sql.query": "SELECT * FROM 'UserInfo' WHERE id = ?",
98
- "sql.rowsCount": 1,
108
+ "livestore.mutateLabel": "mutate",
99
109
  },
110
+ "children": [
111
+ {
112
+ "_name": "livestore.in-memory-db:execute",
113
+ "attributes": {
114
+ "sql.query": "INSERT INTO UserInfo (username, text, id) VALUES ($username, $text, $id)",
115
+ },
116
+ },
117
+ ],
100
118
  },
101
119
  ],
102
120
  },
103
121
  {
104
- "_name": "LiveStore.subscribe",
122
+ "_name": "LiveStore:useQuery:db(row:UserInfo:u1)",
105
123
  "attributes": {
106
- "label": "row:UserInfo:u1",
107
- "queryLabel": "row:UserInfo:u1",
124
+ "label": "db(row:UserInfo:u1)",
125
+ "stackInfo": "{"frames":[{"name":"renderHook.wrapper","filePath":"__REPLACED_FOR_SNAPSHOT__"},{"name":"useRow","filePath":"__REPLACED_FOR_SNAPSHOT__"}]}",
108
126
  },
109
127
  "children": [
110
128
  {
111
129
  "_name": "db:SELECT * FROM 'UserInfo' WHERE id = ?",
112
130
  "attributes": {
113
- "livestore.debugRefreshReason": "mutate",
114
131
  "sql.query": "SELECT * FROM 'UserInfo' WHERE id = ?",
115
132
  "sql.rowsCount": 1,
116
133
  },
@@ -125,6 +142,13 @@ exports[`useRow > otel > should update the data based on component key strictMod
125
142
  },
126
143
  ],
127
144
  },
145
+ {
146
+ "_name": "LiveStore.subscribe",
147
+ "attributes": {
148
+ "label": "db(row:UserInfo:u1)",
149
+ "queryLabel": "db(row:UserInfo:u1)",
150
+ },
151
+ },
128
152
  ],
129
153
  },
130
154
  ],
@@ -132,47 +156,19 @@ exports[`useRow > otel > should update the data based on component key strictMod
132
156
  {
133
157
  "_name": "LiveStore:useRow:UserInfo:u2",
134
158
  "attributes": {
135
- "firstStackInfo": "{"frames":[{"name":"renderHook.wrapper","filePath":"__REPLACED_FOR_SNAPSHOT__"},{"name":"useRow","filePath":"__REPLACED_FOR_SNAPSHOT__"}]}",
136
- "label": "SELECT * FROM 'UserInfo' WHERE id = ?",
159
+ "id": "u2",
137
160
  },
138
161
  "children": [
139
162
  {
140
- "_name": "sql-in-memory-select",
163
+ "_name": "LiveStore:useQuery:db(row:UserInfo:u2)",
141
164
  "attributes": {
142
- "sql.cached": false,
143
- "sql.query": "SELECT 1 FROM 'UserInfo' WHERE id = ?",
144
- "sql.rowsCount": 1,
145
- },
146
- },
147
- {
148
- "_name": "db:SELECT * FROM 'UserInfo' WHERE id = ?",
149
- "attributes": {
150
- "livestore.debugRefreshReason": "useQuery:initial-run:row:UserInfo:u2",
151
- "sql.query": "SELECT * FROM 'UserInfo' WHERE id = ?",
152
- "sql.rowsCount": 1,
153
- },
154
- "children": [
155
- {
156
- "_name": "sql-in-memory-select",
157
- "attributes": {
158
- "sql.cached": false,
159
- "sql.query": "SELECT * FROM 'UserInfo' WHERE id = ?",
160
- "sql.rowsCount": 1,
161
- },
162
- },
163
- ],
164
- },
165
- {
166
- "_name": "LiveStore.subscribe",
167
- "attributes": {
168
- "label": "row:UserInfo:u2",
169
- "queryLabel": "row:UserInfo:u2",
165
+ "label": "db(row:UserInfo:u2)",
166
+ "stackInfo": "{"frames":[{"name":"renderHook.wrapper","filePath":"__REPLACED_FOR_SNAPSHOT__"},{"name":"useRow","filePath":"__REPLACED_FOR_SNAPSHOT__"}]}",
170
167
  },
171
168
  "children": [
172
169
  {
173
170
  "_name": "db:SELECT * FROM 'UserInfo' WHERE id = ?",
174
171
  "attributes": {
175
- "livestore.debugRefreshReason": "subscribe-initial-run:row:UserInfo:u2",
176
172
  "sql.query": "SELECT * FROM 'UserInfo' WHERE id = ?",
177
173
  "sql.rowsCount": 1,
178
174
  },
@@ -180,13 +176,20 @@ exports[`useRow > otel > should update the data based on component key strictMod
180
176
  {
181
177
  "_name": "sql-in-memory-select",
182
178
  "attributes": {
183
- "sql.cached": true,
179
+ "sql.cached": false,
184
180
  "sql.query": "SELECT * FROM 'UserInfo' WHERE id = ?",
185
181
  "sql.rowsCount": 1,
186
182
  },
187
183
  },
188
184
  ],
189
185
  },
186
+ {
187
+ "_name": "LiveStore.subscribe",
188
+ "attributes": {
189
+ "label": "db(row:UserInfo:u2)",
190
+ "queryLabel": "db(row:UserInfo:u2)",
191
+ },
192
+ },
190
193
  ],
191
194
  },
192
195
  ],
@@ -197,7 +200,7 @@ exports[`useRow > otel > should update the data based on component key strictMod
197
200
  }
198
201
  `;
199
202
 
200
- exports[`useRow > otel > should update the data based on component key strictMode={ strictMode: true } 1`] = `
203
+ exports[`useRow > otel > should update the data based on component key > strictMode=true 1`] = `
201
204
  {
202
205
  "_name": "createStore",
203
206
  "attributes": {
@@ -218,6 +221,25 @@ exports[`useRow > otel > should update the data based on component key strictMod
218
221
  ",
219
222
  },
220
223
  },
224
+ {
225
+ "_name": "LiveStore:createStore",
226
+ },
227
+ {
228
+ "_name": "sql-in-memory-select",
229
+ "attributes": {
230
+ "sql.cached": false,
231
+ "sql.query": "SELECT 1 FROM 'UserInfo' WHERE id = ?",
232
+ "sql.rowsCount": 0,
233
+ },
234
+ },
235
+ {
236
+ "_name": "sql-in-memory-select",
237
+ "attributes": {
238
+ "sql.cached": false,
239
+ "sql.query": "SELECT 1 FROM 'UserInfo' WHERE id = ?",
240
+ "sql.rowsCount": 1,
241
+ },
242
+ },
221
243
  {
222
244
  "_name": "LiveStore:sync",
223
245
  },
@@ -227,17 +249,22 @@ exports[`useRow > otel > should update the data based on component key strictMod
227
249
  {
228
250
  "_name": "LiveStore:mutate",
229
251
  "attributes": {
230
- "livestore.mutationEventTags": [
231
- "_Derived_Create_UserInfo",
232
- ],
233
- "livestore.mutationEventsCount": 1,
252
+ "livestore.mutateLabel": "mutate",
234
253
  },
235
254
  "children": [
236
255
  {
237
- "_name": "livestore.in-memory-db:execute",
256
+ "_name": "LiveStore:mutate:applyMutations",
238
257
  "attributes": {
239
- "sql.query": "INSERT INTO UserInfo (username, text, id) VALUES ($username, $text, $id)",
258
+ "livestore.mutateLabel": "mutate",
240
259
  },
260
+ "children": [
261
+ {
262
+ "_name": "livestore.in-memory-db:execute",
263
+ "attributes": {
264
+ "sql.query": "INSERT INTO UserInfo (id, username) VALUES ('u2', 'username_u2')",
265
+ },
266
+ },
267
+ ],
241
268
  },
242
269
  ],
243
270
  },
@@ -247,67 +274,60 @@ exports[`useRow > otel > should update the data based on component key strictMod
247
274
  "_name": "LiveStore:queries",
248
275
  "children": [
249
276
  {
250
- "_name": "LiveStore:useRow:UserInfo:u1",
277
+ "_name": "db:SELECT * FROM 'UserInfo' WHERE id = ?",
251
278
  "attributes": {
252
- "firstStackInfo": "{"frames":[{"name":"renderHook.wrapper","filePath":"__REPLACED_FOR_SNAPSHOT__"},{"name":"useRow","filePath":"__REPLACED_FOR_SNAPSHOT__"}]}",
253
- "label": "SELECT * FROM 'UserInfo' WHERE id = ?",
279
+ "sql.query": "SELECT * FROM 'UserInfo' WHERE id = ?",
280
+ "sql.rowsCount": 1,
254
281
  },
255
282
  "children": [
256
283
  {
257
284
  "_name": "sql-in-memory-select",
258
285
  "attributes": {
259
286
  "sql.cached": false,
260
- "sql.query": "SELECT 1 FROM 'UserInfo' WHERE id = ?",
261
- "sql.rowsCount": 0,
287
+ "sql.query": "SELECT * FROM 'UserInfo' WHERE id = ?",
288
+ "sql.rowsCount": 1,
262
289
  },
263
290
  },
291
+ ],
292
+ },
293
+ {
294
+ "_name": "LiveStore:useRow:UserInfo:u1",
295
+ "attributes": {
296
+ "id": "u1",
297
+ },
298
+ "children": [
264
299
  {
265
300
  "_name": "LiveStore:mutate",
266
301
  "attributes": {
267
- "livestore.mutateLabel": "rowQuery:UserInfo:u1",
268
- "livestore.mutationEventTags": [
269
- "_Derived_Create_UserInfo",
270
- ],
271
- "livestore.mutationEventsCount": 1,
302
+ "livestore.mutateLabel": "mutate",
272
303
  },
273
304
  "children": [
274
305
  {
275
- "_name": "livestore.in-memory-db:execute",
306
+ "_name": "LiveStore:mutate:applyMutations",
276
307
  "attributes": {
277
- "sql.query": "INSERT INTO UserInfo (username, text, id) VALUES ($username, $text, $id)",
278
- },
279
- },
280
- ],
281
- },
282
- {
283
- "_name": "db:SELECT * FROM 'UserInfo' WHERE id = ?",
284
- "attributes": {
285
- "livestore.debugRefreshReason": "useQuery:initial-run:row:UserInfo:u1",
286
- "sql.query": "SELECT * FROM 'UserInfo' WHERE id = ?",
287
- "sql.rowsCount": 1,
288
- },
289
- "children": [
290
- {
291
- "_name": "sql-in-memory-select",
292
- "attributes": {
293
- "sql.cached": false,
294
- "sql.query": "SELECT * FROM 'UserInfo' WHERE id = ?",
295
- "sql.rowsCount": 1,
308
+ "livestore.mutateLabel": "mutate",
296
309
  },
310
+ "children": [
311
+ {
312
+ "_name": "livestore.in-memory-db:execute",
313
+ "attributes": {
314
+ "sql.query": "INSERT INTO UserInfo (username, text, id) VALUES ($username, $text, $id)",
315
+ },
316
+ },
317
+ ],
297
318
  },
298
319
  ],
299
320
  },
300
321
  {
301
- "_name": "LiveStore.subscribe",
322
+ "_name": "LiveStore:useQuery:db(row:UserInfo:u1)",
302
323
  "attributes": {
303
- "label": "row:UserInfo:u1",
304
- "queryLabel": "row:UserInfo:u1",
324
+ "label": "db(row:UserInfo:u1)",
325
+ "stackInfo": "{"frames":[{"name":"renderHook.wrapper","filePath":"__REPLACED_FOR_SNAPSHOT__"},{"name":"useRow","filePath":"__REPLACED_FOR_SNAPSHOT__"}]}",
305
326
  },
306
327
  "children": [
307
328
  {
308
329
  "_name": "db:SELECT * FROM 'UserInfo' WHERE id = ?",
309
330
  "attributes": {
310
- "livestore.debugRefreshReason": "mutate",
311
331
  "sql.query": "SELECT * FROM 'UserInfo' WHERE id = ?",
312
332
  "sql.rowsCount": 1,
313
333
  },
@@ -322,6 +342,20 @@ exports[`useRow > otel > should update the data based on component key strictMod
322
342
  },
323
343
  ],
324
344
  },
345
+ {
346
+ "_name": "LiveStore.subscribe",
347
+ "attributes": {
348
+ "label": "db(row:UserInfo:u1)",
349
+ "queryLabel": "db(row:UserInfo:u1)",
350
+ },
351
+ },
352
+ {
353
+ "_name": "LiveStore.subscribe",
354
+ "attributes": {
355
+ "label": "db(row:UserInfo:u1)",
356
+ "queryLabel": "db(row:UserInfo:u1)",
357
+ },
358
+ },
325
359
  ],
326
360
  },
327
361
  ],
@@ -331,225 +365,3 @@ exports[`useRow > otel > should update the data based on component key strictMod
331
365
  ],
332
366
  }
333
367
  `;
334
-
335
- exports[`useRow > should update the data based on component key 1`] = `
336
- {
337
- "atoms": [
338
- {
339
- "_tag": "ref",
340
- "id": "node-1",
341
- "isDestroyed": false,
342
- "isDirty": false,
343
- "label": "tableRef:todos",
344
- "meta": {
345
- "liveStoreRefType": "table",
346
- },
347
- "previousResult": {
348
- "_tag": "Some",
349
- "value": "null",
350
- },
351
- "refreshes": 0,
352
- "sub": [],
353
- "super": [],
354
- },
355
- {
356
- "_tag": "ref",
357
- "id": "node-2",
358
- "isDestroyed": false,
359
- "isDirty": false,
360
- "label": "tableRef:app",
361
- "meta": {
362
- "liveStoreRefType": "table",
363
- },
364
- "previousResult": {
365
- "_tag": "Some",
366
- "value": "null",
367
- },
368
- "refreshes": 0,
369
- "sub": [],
370
- "super": [],
371
- },
372
- {
373
- "_tag": "ref",
374
- "id": "node-3",
375
- "isDestroyed": false,
376
- "isDirty": false,
377
- "label": "tableRef:UserInfo",
378
- "meta": {
379
- "liveStoreRefType": "table",
380
- },
381
- "previousResult": {
382
- "_tag": "Some",
383
- "value": "null",
384
- },
385
- "refreshes": 1,
386
- "sub": [],
387
- "super": [
388
- "node-5",
389
- ],
390
- },
391
- {
392
- "_tag": "ref",
393
- "id": "node-4",
394
- "isDestroyed": false,
395
- "isDirty": false,
396
- "label": "tableRef:AppRouter",
397
- "meta": {
398
- "liveStoreRefType": "table",
399
- },
400
- "previousResult": {
401
- "_tag": "Some",
402
- "value": "null",
403
- },
404
- "refreshes": 0,
405
- "sub": [],
406
- "super": [],
407
- },
408
- {
409
- "_tag": "thunk",
410
- "id": "node-5",
411
- "isDestroyed": false,
412
- "isDirty": false,
413
- "label": "row:UserInfo:u1:results",
414
- "meta": {
415
- "liveStoreThunkType": "db.result",
416
- },
417
- "previousResult": {
418
- "_tag": "Some",
419
- "value": "{"username":"","text":"","id":"u1"}",
420
- },
421
- "recomputations": 1,
422
- "sub": [
423
- "node-3",
424
- ],
425
- "super": [
426
- "node-6",
427
- ],
428
- },
429
- ],
430
- "deferredEffects": [],
431
- "effects": [
432
- {
433
- "_tag": "effect",
434
- "id": "node-6",
435
- "invocations": 1,
436
- "isDestroyed": false,
437
- "label": "subscribe:row:UserInfo:u1",
438
- "sub": [
439
- "node-5",
440
- ],
441
- },
442
- ],
443
- }
444
- `;
445
-
446
- exports[`useRow > should update the data based on component key 2`] = `
447
- {
448
- "atoms": [
449
- {
450
- "_tag": "ref",
451
- "id": "node-1",
452
- "isDestroyed": false,
453
- "isDirty": false,
454
- "label": "tableRef:todos",
455
- "meta": {
456
- "liveStoreRefType": "table",
457
- },
458
- "previousResult": {
459
- "_tag": "Some",
460
- "value": "null",
461
- },
462
- "refreshes": 0,
463
- "sub": [],
464
- "super": [],
465
- },
466
- {
467
- "_tag": "ref",
468
- "id": "node-2",
469
- "isDestroyed": false,
470
- "isDirty": false,
471
- "label": "tableRef:app",
472
- "meta": {
473
- "liveStoreRefType": "table",
474
- },
475
- "previousResult": {
476
- "_tag": "Some",
477
- "value": "null",
478
- },
479
- "refreshes": 0,
480
- "sub": [],
481
- "super": [],
482
- },
483
- {
484
- "_tag": "ref",
485
- "id": "node-3",
486
- "isDestroyed": false,
487
- "isDirty": false,
488
- "label": "tableRef:UserInfo",
489
- "meta": {
490
- "liveStoreRefType": "table",
491
- },
492
- "previousResult": {
493
- "_tag": "Some",
494
- "value": "null",
495
- },
496
- "refreshes": 2,
497
- "sub": [],
498
- "super": [
499
- "node-7",
500
- ],
501
- },
502
- {
503
- "_tag": "ref",
504
- "id": "node-4",
505
- "isDestroyed": false,
506
- "isDirty": false,
507
- "label": "tableRef:AppRouter",
508
- "meta": {
509
- "liveStoreRefType": "table",
510
- },
511
- "previousResult": {
512
- "_tag": "Some",
513
- "value": "null",
514
- },
515
- "refreshes": 0,
516
- "sub": [],
517
- "super": [],
518
- },
519
- {
520
- "_tag": "thunk",
521
- "id": "node-7",
522
- "isDestroyed": false,
523
- "isDirty": false,
524
- "label": "row:UserInfo:u2:results",
525
- "meta": {
526
- "liveStoreThunkType": "db.result",
527
- },
528
- "previousResult": {
529
- "_tag": "Some",
530
- "value": "{"username":"username_u2","text":"","id":"u2"}",
531
- },
532
- "recomputations": 2,
533
- "sub": [
534
- "node-3",
535
- ],
536
- "super": [
537
- "node-8",
538
- ],
539
- },
540
- ],
541
- "deferredEffects": [],
542
- "effects": [
543
- {
544
- "_tag": "effect",
545
- "id": "node-8",
546
- "invocations": 1,
547
- "isDestroyed": false,
548
- "label": "subscribe:row:UserInfo:u2",
549
- "sub": [
550
- "node-7",
551
- ],
552
- },
553
- ],
554
- }
555
- `;