@livestore/react 0.3.0-dev.10 → 0.3.0-dev.12

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