@livestore/react 0.0.0-snapshot-d9d66b354a9f4cfae987725d38971992ff14e4ad → 0.0.0-snapshot-1d99fea7d2ce2c7a5d9ed0a3752f8a7bda6bc3db

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