@livestore/react 0.2.0 → 0.3.0-dev.11

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 (87) 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 +6 -4
  7. package/dist/LiveStoreProvider.d.ts.map +1 -1
  8. package/dist/LiveStoreProvider.js +47 -45
  9. package/dist/LiveStoreProvider.js.map +1 -1
  10. package/dist/LiveStoreProvider.test.js +8 -2
  11. package/dist/LiveStoreProvider.test.js.map +1 -1
  12. package/dist/__tests__/fixture.d.ts +7 -10
  13. package/dist/__tests__/fixture.d.ts.map +1 -1
  14. package/dist/__tests__/fixture.js +10 -15
  15. package/dist/__tests__/fixture.js.map +1 -1
  16. package/dist/experimental/components/LiveList.d.ts +2 -2
  17. package/dist/experimental/components/LiveList.d.ts.map +1 -1
  18. package/dist/experimental/components/LiveList.js +5 -4
  19. package/dist/experimental/components/LiveList.js.map +1 -1
  20. package/dist/mod.d.ts +0 -1
  21. package/dist/mod.d.ts.map +1 -1
  22. package/dist/mod.js +0 -1
  23. package/dist/mod.js.map +1 -1
  24. package/dist/useAtom.d.ts +4 -2
  25. package/dist/useAtom.d.ts.map +1 -1
  26. package/dist/useAtom.js +32 -28
  27. package/dist/useAtom.js.map +1 -1
  28. package/dist/useQuery.d.ts +26 -3
  29. package/dist/useQuery.d.ts.map +1 -1
  30. package/dist/useQuery.js +60 -45
  31. package/dist/useQuery.js.map +1 -1
  32. package/dist/useQuery.test.js +70 -16
  33. package/dist/useQuery.test.js.map +1 -1
  34. package/dist/useRcRef.d.ts +72 -0
  35. package/dist/useRcRef.d.ts.map +1 -0
  36. package/dist/useRcRef.js +146 -0
  37. package/dist/useRcRef.js.map +1 -0
  38. package/dist/useRcRef.test.d.ts +2 -0
  39. package/dist/useRcRef.test.d.ts.map +1 -0
  40. package/dist/useRcRef.test.js +128 -0
  41. package/dist/useRcRef.test.js.map +1 -0
  42. package/dist/useRcResource.d.ts +76 -0
  43. package/dist/useRcResource.d.ts.map +1 -0
  44. package/dist/useRcResource.js +150 -0
  45. package/dist/useRcResource.js.map +1 -0
  46. package/dist/useRcResource.test.d.ts +2 -0
  47. package/dist/useRcResource.test.d.ts.map +1 -0
  48. package/dist/useRcResource.test.js +122 -0
  49. package/dist/useRcResource.test.js.map +1 -0
  50. package/dist/useRow.d.ts +10 -7
  51. package/dist/useRow.d.ts.map +1 -1
  52. package/dist/useRow.js +16 -19
  53. package/dist/useRow.js.map +1 -1
  54. package/dist/useRow.test.js +74 -97
  55. package/dist/useRow.test.js.map +1 -1
  56. package/dist/useScopedQuery.d.ts +10 -4
  57. package/dist/useScopedQuery.d.ts.map +1 -1
  58. package/dist/useScopedQuery.js +97 -52
  59. package/dist/useScopedQuery.js.map +1 -1
  60. package/dist/useScopedQuery.test.js +13 -12
  61. package/dist/useScopedQuery.test.js.map +1 -1
  62. package/dist/utils/useStateRefWithReactiveInput.d.ts +1 -1
  63. package/dist/utils/useStateRefWithReactiveInput.d.ts.map +1 -1
  64. package/dist/utils/useStateRefWithReactiveInput.js.map +1 -1
  65. package/package.json +18 -17
  66. package/src/LiveStoreContext.ts +10 -6
  67. package/src/LiveStoreProvider.test.tsx +13 -2
  68. package/src/LiveStoreProvider.tsx +69 -53
  69. package/src/__snapshots__/useQuery.test.tsx.snap +2011 -0
  70. package/src/__snapshots__/useRow.test.tsx.snap +347 -151
  71. package/src/__tests__/fixture.tsx +11 -19
  72. package/src/experimental/components/LiveList.tsx +8 -7
  73. package/src/mod.ts +0 -1
  74. package/src/useAtom.ts +22 -11
  75. package/src/useQuery.test.tsx +165 -67
  76. package/src/useQuery.ts +84 -54
  77. package/src/useRcResource.test.tsx +167 -0
  78. package/src/useRcResource.ts +180 -0
  79. package/src/useRow.test.tsx +130 -164
  80. package/src/useRow.ts +32 -35
  81. package/src/utils/useStateRefWithReactiveInput.ts +1 -1
  82. package/dist/useTemporaryQuery.d.ts +0 -22
  83. package/dist/useTemporaryQuery.d.ts.map +0 -1
  84. package/dist/useTemporaryQuery.js +0 -75
  85. package/dist/useTemporaryQuery.js.map +0 -1
  86. package/src/useScopedQuery.test.tsx +0 -96
  87. package/src/useScopedQuery.ts +0 -142
@@ -1,8 +1,12 @@
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=false 1`] = `
3
+ exports[`useRow > otel > should update the data based on component key strictMode={ strictMode: false } 1`] = `
4
4
  {
5
- "_name": "test",
5
+ "_name": "createStore",
6
+ "attributes": {
7
+ "debugInstanceId": "test",
8
+ "storeId": "default",
9
+ },
6
10
  "children": [
7
11
  {
8
12
  "_name": "livestore.in-memory-db:execute",
@@ -18,20 +22,7 @@ exports[`useRow > otel > should update the data based on component key > strictM
18
22
  },
19
23
  },
20
24
  {
21
- "_name": "sql-in-memory-select",
22
- "attributes": {
23
- "sql.cached": false,
24
- "sql.query": "SELECT 1 FROM 'UserInfo' WHERE id = ?",
25
- "sql.rowsCount": 0,
26
- },
27
- },
28
- {
29
- "_name": "sql-in-memory-select",
30
- "attributes": {
31
- "sql.cached": false,
32
- "sql.query": "SELECT 1 FROM 'UserInfo' WHERE id = ?",
33
- "sql.rowsCount": 1,
34
- },
25
+ "_name": "LiveStore:sync",
35
26
  },
36
27
  {
37
28
  "_name": "LiveStore:mutations",
@@ -39,33 +30,17 @@ exports[`useRow > otel > should update the data based on component key > strictM
39
30
  {
40
31
  "_name": "LiveStore:mutate",
41
32
  "attributes": {
42
- "livestore.mutateLabel": "mutate",
33
+ "livestore.mutationEventTags": [
34
+ "_Derived_Create_UserInfo",
35
+ ],
36
+ "livestore.mutationEventsCount": 1,
43
37
  },
44
38
  "children": [
45
39
  {
46
- "_name": "LiveStore:processWrites",
40
+ "_name": "livestore.in-memory-db:execute",
47
41
  "attributes": {
48
- "livestore.mutateLabel": "mutate",
42
+ "sql.query": "INSERT INTO UserInfo (username, text, id) VALUES ($username, $text, $id)",
49
43
  },
50
- "children": [
51
- {
52
- "_name": "LiveStore:mutateWithoutRefresh",
53
- "attributes": {
54
- "livestore.args": "{
55
- "sql": "INSERT INTO UserInfo (id, username) VALUES ('u2', 'username_u2')"
56
- }",
57
- "livestore.mutation": "livestore.RawSql",
58
- },
59
- "children": [
60
- {
61
- "_name": "livestore.in-memory-db:execute",
62
- "attributes": {
63
- "sql.query": "INSERT INTO UserInfo (id, username) VALUES ('u2', 'username_u2')",
64
- },
65
- },
66
- ],
67
- },
68
- ],
69
44
  },
70
45
  ],
71
46
  },
@@ -75,35 +50,28 @@ exports[`useRow > otel > should update the data based on component key > strictM
75
50
  "_name": "LiveStore:queries",
76
51
  "children": [
77
52
  {
78
- "_name": "db:SELECT * FROM 'UserInfo' WHERE id = ?",
53
+ "_name": "LiveStore:useRow:UserInfo:u1",
79
54
  "attributes": {
80
- "sql.query": "SELECT * FROM 'UserInfo' WHERE id = ?",
81
- "sql.rowsCount": 1,
55
+ "firstStackInfo": "{"frames":[{"name":"renderHook.wrapper","filePath":"__REPLACED_FOR_SNAPSHOT__"},{"name":"useRow","filePath":"__REPLACED_FOR_SNAPSHOT__"}]}",
56
+ "label": "SELECT * FROM 'UserInfo' WHERE id = ?",
82
57
  },
83
58
  "children": [
84
59
  {
85
60
  "_name": "sql-in-memory-select",
86
61
  "attributes": {
87
62
  "sql.cached": false,
88
- "sql.query": "SELECT * FROM 'UserInfo' WHERE id = ?",
89
- "sql.rowsCount": 1,
63
+ "sql.query": "SELECT 1 FROM 'UserInfo' WHERE id = ?",
64
+ "sql.rowsCount": 0,
90
65
  },
91
66
  },
92
- ],
93
- },
94
- {
95
- "_name": "LiveStore:useRow:UserInfo:u1",
96
- "attributes": {
97
- "id": "u1",
98
- },
99
- "children": [
100
67
  {
101
- "_name": "LiveStore:mutateWithoutRefresh",
68
+ "_name": "LiveStore:mutate",
102
69
  "attributes": {
103
- "livestore.args": "{
104
- "id": "u1"
105
- }",
106
- "livestore.mutation": "_Derived_Create_UserInfo",
70
+ "livestore.mutateLabel": "rowQuery:UserInfo:u1",
71
+ "livestore.mutationEventTags": [
72
+ "_Derived_Create_UserInfo",
73
+ ],
74
+ "livestore.mutationEventsCount": 1,
107
75
  },
108
76
  "children": [
109
77
  {
@@ -115,15 +83,34 @@ exports[`useRow > otel > should update the data based on component key > strictM
115
83
  ],
116
84
  },
117
85
  {
118
- "_name": "LiveStore:useQuery:db(row:UserInfo:u1)",
86
+ "_name": "db:SELECT * FROM 'UserInfo' WHERE id = ?",
119
87
  "attributes": {
120
- "label": "db(row:UserInfo:u1)",
121
- "stackInfo": "{"frames":[{"name":"renderHook.wrapper","filePath":"__REPLACED_FOR_SNAPSHOT__"},{"name":"useRow","filePath":"__REPLACED_FOR_SNAPSHOT__"}]}",
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,
99
+ },
100
+ },
101
+ ],
102
+ },
103
+ {
104
+ "_name": "LiveStore.subscribe",
105
+ "attributes": {
106
+ "label": "row:UserInfo:u1",
107
+ "queryLabel": "row:UserInfo:u1",
122
108
  },
123
109
  "children": [
124
110
  {
125
111
  "_name": "db:SELECT * FROM 'UserInfo' WHERE id = ?",
126
112
  "attributes": {
113
+ "livestore.debugRefreshReason": "mutate",
127
114
  "sql.query": "SELECT * FROM 'UserInfo' WHERE id = ?",
128
115
  "sql.rowsCount": 1,
129
116
  },
@@ -138,13 +125,6 @@ exports[`useRow > otel > should update the data based on component key > strictM
138
125
  },
139
126
  ],
140
127
  },
141
- {
142
- "_name": "LiveStore.subscribe",
143
- "attributes": {
144
- "label": "db(row:UserInfo:u1)",
145
- "queryLabel": "db(row:UserInfo:u1)",
146
- },
147
- },
148
128
  ],
149
129
  },
150
130
  ],
@@ -152,19 +132,47 @@ exports[`useRow > otel > should update the data based on component key > strictM
152
132
  {
153
133
  "_name": "LiveStore:useRow:UserInfo:u2",
154
134
  "attributes": {
155
- "id": "u2",
135
+ "firstStackInfo": "{"frames":[{"name":"renderHook.wrapper","filePath":"__REPLACED_FOR_SNAPSHOT__"},{"name":"useRow","filePath":"__REPLACED_FOR_SNAPSHOT__"}]}",
136
+ "label": "SELECT * FROM 'UserInfo' WHERE id = ?",
156
137
  },
157
138
  "children": [
158
139
  {
159
- "_name": "LiveStore:useQuery:db(row:UserInfo:u2)",
140
+ "_name": "sql-in-memory-select",
160
141
  "attributes": {
161
- "label": "db(row:UserInfo:u2)",
162
- "stackInfo": "{"frames":[{"name":"renderHook.wrapper","filePath":"__REPLACED_FOR_SNAPSHOT__"},{"name":"useRow","filePath":"__REPLACED_FOR_SNAPSHOT__"}]}",
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",
163
170
  },
164
171
  "children": [
165
172
  {
166
173
  "_name": "db:SELECT * FROM 'UserInfo' WHERE id = ?",
167
174
  "attributes": {
175
+ "livestore.debugRefreshReason": "subscribe-initial-run:row:UserInfo:u2",
168
176
  "sql.query": "SELECT * FROM 'UserInfo' WHERE id = ?",
169
177
  "sql.rowsCount": 1,
170
178
  },
@@ -172,20 +180,13 @@ exports[`useRow > otel > should update the data based on component key > strictM
172
180
  {
173
181
  "_name": "sql-in-memory-select",
174
182
  "attributes": {
175
- "sql.cached": false,
183
+ "sql.cached": true,
176
184
  "sql.query": "SELECT * FROM 'UserInfo' WHERE id = ?",
177
185
  "sql.rowsCount": 1,
178
186
  },
179
187
  },
180
188
  ],
181
189
  },
182
- {
183
- "_name": "LiveStore.subscribe",
184
- "attributes": {
185
- "label": "db(row:UserInfo:u2)",
186
- "queryLabel": "db(row:UserInfo:u2)",
187
- },
188
- },
189
190
  ],
190
191
  },
191
192
  ],
@@ -196,9 +197,13 @@ exports[`useRow > otel > should update the data based on component key > strictM
196
197
  }
197
198
  `;
198
199
 
199
- exports[`useRow > otel > should update the data based on component key > strictMode=true 1`] = `
200
+ exports[`useRow > otel > should update the data based on component key strictMode={ strictMode: true } 1`] = `
200
201
  {
201
- "_name": "test",
202
+ "_name": "createStore",
203
+ "attributes": {
204
+ "debugInstanceId": "test",
205
+ "storeId": "default",
206
+ },
202
207
  "children": [
203
208
  {
204
209
  "_name": "livestore.in-memory-db:execute",
@@ -214,20 +219,7 @@ exports[`useRow > otel > should update the data based on component key > strictM
214
219
  },
215
220
  },
216
221
  {
217
- "_name": "sql-in-memory-select",
218
- "attributes": {
219
- "sql.cached": false,
220
- "sql.query": "SELECT 1 FROM 'UserInfo' WHERE id = ?",
221
- "sql.rowsCount": 0,
222
- },
223
- },
224
- {
225
- "_name": "sql-in-memory-select",
226
- "attributes": {
227
- "sql.cached": false,
228
- "sql.query": "SELECT 1 FROM 'UserInfo' WHERE id = ?",
229
- "sql.rowsCount": 1,
230
- },
222
+ "_name": "LiveStore:sync",
231
223
  },
232
224
  {
233
225
  "_name": "LiveStore:mutations",
@@ -235,33 +227,17 @@ exports[`useRow > otel > should update the data based on component key > strictM
235
227
  {
236
228
  "_name": "LiveStore:mutate",
237
229
  "attributes": {
238
- "livestore.mutateLabel": "mutate",
230
+ "livestore.mutationEventTags": [
231
+ "_Derived_Create_UserInfo",
232
+ ],
233
+ "livestore.mutationEventsCount": 1,
239
234
  },
240
235
  "children": [
241
236
  {
242
- "_name": "LiveStore:processWrites",
237
+ "_name": "livestore.in-memory-db:execute",
243
238
  "attributes": {
244
- "livestore.mutateLabel": "mutate",
239
+ "sql.query": "INSERT INTO UserInfo (username, text, id) VALUES ($username, $text, $id)",
245
240
  },
246
- "children": [
247
- {
248
- "_name": "LiveStore:mutateWithoutRefresh",
249
- "attributes": {
250
- "livestore.args": "{
251
- "sql": "INSERT INTO UserInfo (id, username) VALUES ('u2', 'username_u2')"
252
- }",
253
- "livestore.mutation": "livestore.RawSql",
254
- },
255
- "children": [
256
- {
257
- "_name": "livestore.in-memory-db:execute",
258
- "attributes": {
259
- "sql.query": "INSERT INTO UserInfo (id, username) VALUES ('u2', 'username_u2')",
260
- },
261
- },
262
- ],
263
- },
264
- ],
265
241
  },
266
242
  ],
267
243
  },
@@ -271,35 +247,28 @@ exports[`useRow > otel > should update the data based on component key > strictM
271
247
  "_name": "LiveStore:queries",
272
248
  "children": [
273
249
  {
274
- "_name": "db:SELECT * FROM 'UserInfo' WHERE id = ?",
250
+ "_name": "LiveStore:useRow:UserInfo:u1",
275
251
  "attributes": {
276
- "sql.query": "SELECT * FROM 'UserInfo' WHERE id = ?",
277
- "sql.rowsCount": 1,
252
+ "firstStackInfo": "{"frames":[{"name":"renderHook.wrapper","filePath":"__REPLACED_FOR_SNAPSHOT__"},{"name":"useRow","filePath":"__REPLACED_FOR_SNAPSHOT__"}]}",
253
+ "label": "SELECT * FROM 'UserInfo' WHERE id = ?",
278
254
  },
279
255
  "children": [
280
256
  {
281
257
  "_name": "sql-in-memory-select",
282
258
  "attributes": {
283
259
  "sql.cached": false,
284
- "sql.query": "SELECT * FROM 'UserInfo' WHERE id = ?",
285
- "sql.rowsCount": 1,
260
+ "sql.query": "SELECT 1 FROM 'UserInfo' WHERE id = ?",
261
+ "sql.rowsCount": 0,
286
262
  },
287
263
  },
288
- ],
289
- },
290
- {
291
- "_name": "LiveStore:useRow:UserInfo:u1",
292
- "attributes": {
293
- "id": "u1",
294
- },
295
- "children": [
296
264
  {
297
- "_name": "LiveStore:mutateWithoutRefresh",
265
+ "_name": "LiveStore:mutate",
298
266
  "attributes": {
299
- "livestore.args": "{
300
- "id": "u1"
301
- }",
302
- "livestore.mutation": "_Derived_Create_UserInfo",
267
+ "livestore.mutateLabel": "rowQuery:UserInfo:u1",
268
+ "livestore.mutationEventTags": [
269
+ "_Derived_Create_UserInfo",
270
+ ],
271
+ "livestore.mutationEventsCount": 1,
303
272
  },
304
273
  "children": [
305
274
  {
@@ -311,15 +280,34 @@ exports[`useRow > otel > should update the data based on component key > strictM
311
280
  ],
312
281
  },
313
282
  {
314
- "_name": "LiveStore:useQuery:db(row:UserInfo:u1)",
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,
296
+ },
297
+ },
298
+ ],
299
+ },
300
+ {
301
+ "_name": "LiveStore.subscribe",
315
302
  "attributes": {
316
- "label": "db(row:UserInfo:u1)",
317
- "stackInfo": "{"frames":[{"name":"renderHook.wrapper","filePath":"__REPLACED_FOR_SNAPSHOT__"},{"name":"useRow","filePath":"__REPLACED_FOR_SNAPSHOT__"}]}",
303
+ "label": "row:UserInfo:u1",
304
+ "queryLabel": "row:UserInfo:u1",
318
305
  },
319
306
  "children": [
320
307
  {
321
308
  "_name": "db:SELECT * FROM 'UserInfo' WHERE id = ?",
322
309
  "attributes": {
310
+ "livestore.debugRefreshReason": "mutate",
323
311
  "sql.query": "SELECT * FROM 'UserInfo' WHERE id = ?",
324
312
  "sql.rowsCount": 1,
325
313
  },
@@ -334,20 +322,6 @@ exports[`useRow > otel > should update the data based on component key > strictM
334
322
  },
335
323
  ],
336
324
  },
337
- {
338
- "_name": "LiveStore.subscribe",
339
- "attributes": {
340
- "label": "db(row:UserInfo:u1)",
341
- "queryLabel": "db(row:UserInfo:u1)",
342
- },
343
- },
344
- {
345
- "_name": "LiveStore.subscribe",
346
- "attributes": {
347
- "label": "db(row:UserInfo:u1)",
348
- "queryLabel": "db(row:UserInfo:u1)",
349
- },
350
- },
351
325
  ],
352
326
  },
353
327
  ],
@@ -357,3 +331,225 @@ exports[`useRow > otel > should update the data based on component key > strictM
357
331
  ],
358
332
  }
359
333
  `;
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
+ `;