@arrai-innovations/reactive-helpers 16.0.0 → 17.0.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.
- package/.husky/commit-msg +0 -1
- package/.husky/pre-commit +0 -1
- package/docs/README.md +1 -1
- package/docs/config/listCrud.md +67 -33
- package/docs/config/objectCrud.md +58 -30
- package/docs/use/cancellableIntent.md +10 -8
- package/docs/use/combineClasses.md +7 -5
- package/docs/use/list.md +24 -18
- package/docs/use/listCalculated.md +103 -101
- package/docs/use/listFilter.md +138 -136
- package/docs/use/listInstance.md +44 -28
- package/docs/use/listKeys.md +1 -1
- package/docs/use/listRelated.md +58 -56
- package/docs/use/listSearch.md +124 -122
- package/docs/use/listSort.md +209 -201
- package/docs/use/listSubscription.md +19 -13
- package/docs/use/loadingError.md +7 -5
- package/docs/use/object.md +85 -59
- package/docs/use/objectCalculated.md +122 -96
- package/docs/use/objectInstance.md +97 -61
- package/docs/use/objectRelated.md +99 -73
- package/docs/use/objectSubscription.md +59 -37
- package/docs/use/paginatedListInstance.md +8 -6
- package/docs/use/proxyLoadingError.md +11 -9
- package/docs/use/search.md +16 -12
- package/docs/use/watchesRunning.md +8 -4
- package/docs/utils/assignReactiveObject.md +96 -48
- package/docs/utils/classes.md +43 -17
- package/docs/utils/compact.md +10 -4
- package/docs/utils/deleteKey.md +13 -5
- package/docs/utils/flattenPaths.md +14 -6
- package/docs/utils/getFakePk.md +7 -3
- package/docs/utils/keepAliveTry.md +13 -5
- package/docs/utils/keyDiff.md +30 -18
- package/docs/utils/loadingCombine.md +4 -2
- package/docs/utils/proxyRunning.md +10 -4
- package/docs/utils/relatedCalculatedHelpers.md +22 -8
- package/docs/utils/set.md +37 -13
- package/docs/utils/transformWalk.md +10 -4
- package/docs/utils/watches.md +77 -31
- package/package.json +3 -3
- package/tests/unit/use/listInstance.spec.js +4 -5
- package/tests/unit/use/listSubscription.spec.js +7 -7
- package/tests/unit/use/objectInstance.spec.js +3 -3
- package/tests/unit/use/objectSubscription.spec.js +4 -3
- package/tests/unit/utils/classes.spec.js +304 -14
- package/use/list.js +3 -4
- package/use/listCalculated.js +6 -6
- package/use/listRelated.js +6 -3
- package/use/listSearch.js +1 -1
- package/use/objectRelated.js +6 -3
- package/utils/classes.js +127 -116
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[**@arrai-innovations/reactive-helpers**](../README.md)
|
|
1
|
+
[**@arrai-innovations/reactive-helpers**](../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
@@ -16,7 +16,7 @@ Options to configure the behavior of the list calculated properties.
|
|
|
16
16
|
|
|
17
17
|
##### calculatedObjectsRules
|
|
18
18
|
|
|
19
|
-
> **calculatedObjectsRules**: `Ref`\<`object`\>
|
|
19
|
+
> **calculatedObjectsRules**: `Ref`\<`object`, `object`\>
|
|
20
20
|
|
|
21
21
|
A reactive reference to rules used for dynamic calculations
|
|
22
22
|
within list objects. Proper setup of this reference ensures that updates are managed reactively, including deep
|
|
@@ -40,9 +40,9 @@ CRUD functions and their configurations for the list.
|
|
|
40
40
|
|
|
41
41
|
Arguments for the CRUD functions.
|
|
42
42
|
|
|
43
|
-
###### crud.list
|
|
43
|
+
###### crud.list?
|
|
44
44
|
|
|
45
|
-
> **list**: `Function`
|
|
45
|
+
> `optional` **list**: `Function`
|
|
46
46
|
|
|
47
47
|
Function to list objects.
|
|
48
48
|
|
|
@@ -58,9 +58,9 @@ The last error encountered.
|
|
|
58
58
|
|
|
59
59
|
Indicates if an error occurred during the last operation.
|
|
60
60
|
|
|
61
|
-
###### fkForPkAndRule
|
|
61
|
+
###### fkForPkAndRule?
|
|
62
62
|
|
|
63
|
-
> **fkForPkAndRule**: `object`
|
|
63
|
+
> `optional` **fkForPkAndRule**: `object`
|
|
64
64
|
|
|
65
65
|
Maintains computed references to the foreign keys for each object pk and rule, crucial for navigating complex data relationships.
|
|
66
66
|
|
|
@@ -68,15 +68,15 @@ Maintains computed references to the foreign keys for each object pk and rule, c
|
|
|
68
68
|
|
|
69
69
|
\[`pk`: `string`\]: `object`
|
|
70
70
|
|
|
71
|
-
###### intendToList
|
|
71
|
+
###### intendToList?
|
|
72
72
|
|
|
73
|
-
> **intendToList**: `boolean`
|
|
73
|
+
> `optional` **intendToList**: `boolean`
|
|
74
74
|
|
|
75
75
|
If this is true, the list should be fetched, or re-fetched if arguments change.
|
|
76
76
|
|
|
77
|
-
###### intendToSubscribe
|
|
77
|
+
###### intendToSubscribe?
|
|
78
78
|
|
|
79
|
-
> **intendToSubscribe**: `boolean`
|
|
79
|
+
> `optional` **intendToSubscribe**: `boolean`
|
|
80
80
|
|
|
81
81
|
If this is true, the subscription should start or restart if arguments change.
|
|
82
82
|
|
|
@@ -86,15 +86,15 @@ If this is true, the subscription should start or restart if arguments change.
|
|
|
86
86
|
|
|
87
87
|
Arguments passed to the server for listing operations.
|
|
88
88
|
|
|
89
|
-
###### loading
|
|
89
|
+
###### loading?
|
|
90
90
|
|
|
91
|
-
> **loading**: `boolean`
|
|
91
|
+
> `optional` **loading**: `boolean`
|
|
92
92
|
|
|
93
93
|
Indicates if the list is currently loading.
|
|
94
94
|
|
|
95
|
-
###### objAndKeyForPkAndRule
|
|
95
|
+
###### objAndKeyForPkAndRule?
|
|
96
96
|
|
|
97
|
-
> **objAndKeyForPkAndRule**: `object`
|
|
97
|
+
> `optional` **objAndKeyForPkAndRule**: `object`
|
|
98
98
|
|
|
99
99
|
Maps each object pk and rule to a tuple consisting of the related object and its respective key, facilitating direct data manipulation.
|
|
100
100
|
|
|
@@ -126,9 +126,9 @@ The order of objects in the list.
|
|
|
126
126
|
|
|
127
127
|
The primary key field for the list objects.
|
|
128
128
|
|
|
129
|
-
###### relatedObjects
|
|
129
|
+
###### relatedObjects?
|
|
130
130
|
|
|
131
|
-
> **relatedObjects**: `object`
|
|
131
|
+
> `optional` **relatedObjects**: `object`
|
|
132
132
|
|
|
133
133
|
Stores computed references to related objects, allowing for dynamic access based on object pk and specific rules.
|
|
134
134
|
|
|
@@ -136,15 +136,15 @@ Stores computed references to related objects, allowing for dynamic access based
|
|
|
136
136
|
|
|
137
137
|
\[`pk`: `string`\]: `object`
|
|
138
138
|
|
|
139
|
-
###### relatedObjectsParentStateObjectsWatchRunning
|
|
139
|
+
###### relatedObjectsParentStateObjectsWatchRunning?
|
|
140
140
|
|
|
141
|
-
> **relatedObjectsParentStateObjectsWatchRunning**: `boolean`
|
|
141
|
+
> `optional` **relatedObjectsParentStateObjectsWatchRunning**: `boolean`
|
|
142
142
|
|
|
143
143
|
Flags whether the watch on parent state objects is currently active, ensuring updates trigger as needed.
|
|
144
144
|
|
|
145
|
-
###### relatedObjectsRules
|
|
145
|
+
###### relatedObjectsRules?
|
|
146
146
|
|
|
147
|
-
> **relatedObjectsRules**: `object`
|
|
147
|
+
> `optional` **relatedObjectsRules**: `object`
|
|
148
148
|
|
|
149
149
|
Defines the rules for establishing relationships, such as foreign key links and sorting orders.
|
|
150
150
|
|
|
@@ -152,15 +152,15 @@ Defines the rules for establishing relationships, such as foreign key links and
|
|
|
152
152
|
|
|
153
153
|
\[`rule`: `string`\]: [`ListRelatedRule`](listRelated.md#listrelatedrule)
|
|
154
154
|
|
|
155
|
-
###### relatedObjectsWatchRunning
|
|
155
|
+
###### relatedObjectsWatchRunning?
|
|
156
156
|
|
|
157
|
-
> **relatedObjectsWatchRunning**: `boolean`
|
|
157
|
+
> `optional` **relatedObjectsWatchRunning**: `boolean`
|
|
158
158
|
|
|
159
159
|
Indicates if watches on the related objects themselves are active, managing updates efficiently.
|
|
160
160
|
|
|
161
|
-
###### relatedRunning
|
|
161
|
+
###### relatedRunning?
|
|
162
162
|
|
|
163
|
-
> **relatedRunning**: `boolean`
|
|
163
|
+
> `optional` **relatedRunning**: `boolean`
|
|
164
164
|
|
|
165
165
|
Signals whether any computations related to object relationships are currently in progress.
|
|
166
166
|
|
|
@@ -176,27 +176,27 @@ Arguments passed to the server for retrieval operations.
|
|
|
176
176
|
|
|
177
177
|
Indicates if there are ongoing reactive updates.
|
|
178
178
|
|
|
179
|
-
###### subscribed
|
|
179
|
+
###### subscribed?
|
|
180
180
|
|
|
181
|
-
> **subscribed**: `boolean`
|
|
181
|
+
> `optional` **subscribed**: `boolean`
|
|
182
182
|
|
|
183
183
|
Whether the subscription is active.
|
|
184
184
|
|
|
185
|
-
###### subscriptionError
|
|
185
|
+
###### subscriptionError?
|
|
186
186
|
|
|
187
|
-
> **subscriptionError**: `Error`
|
|
187
|
+
> `optional` **subscriptionError**: `Error`
|
|
188
188
|
|
|
189
189
|
The error that occurred.
|
|
190
190
|
|
|
191
|
-
###### subscriptionErrored
|
|
191
|
+
###### subscriptionErrored?
|
|
192
192
|
|
|
193
|
-
> **subscriptionErrored**: `boolean`
|
|
193
|
+
> `optional` **subscriptionErrored**: `boolean`
|
|
194
194
|
|
|
195
195
|
Whether the subscription has errored.
|
|
196
196
|
|
|
197
|
-
###### subscriptionLoading
|
|
197
|
+
###### subscriptionLoading?
|
|
198
198
|
|
|
199
|
-
> **subscriptionLoading**: `boolean`
|
|
199
|
+
> `optional` **subscriptionLoading**: `boolean`
|
|
200
200
|
|
|
201
201
|
Whether the subscription is loading.
|
|
202
202
|
|
|
@@ -230,9 +230,9 @@ CRUD functions and their configurations for the list.
|
|
|
230
230
|
|
|
231
231
|
Arguments for the CRUD functions.
|
|
232
232
|
|
|
233
|
-
###### crud.list
|
|
233
|
+
###### crud.list?
|
|
234
234
|
|
|
235
|
-
> **list**: `Function`
|
|
235
|
+
> `optional` **list**: `Function`
|
|
236
236
|
|
|
237
237
|
Function to list objects.
|
|
238
238
|
|
|
@@ -248,9 +248,9 @@ The last error encountered.
|
|
|
248
248
|
|
|
249
249
|
Indicates if an error occurred during the last operation.
|
|
250
250
|
|
|
251
|
-
###### fkForPkAndRule
|
|
251
|
+
###### fkForPkAndRule?
|
|
252
252
|
|
|
253
|
-
> **fkForPkAndRule**: `object`
|
|
253
|
+
> `optional` **fkForPkAndRule**: `object`
|
|
254
254
|
|
|
255
255
|
Maintains computed references to the foreign keys for each object pk and rule, crucial for navigating complex data relationships.
|
|
256
256
|
|
|
@@ -258,15 +258,15 @@ Maintains computed references to the foreign keys for each object pk and rule, c
|
|
|
258
258
|
|
|
259
259
|
\[`pk`: `string`\]: `object`
|
|
260
260
|
|
|
261
|
-
###### intendToList
|
|
261
|
+
###### intendToList?
|
|
262
262
|
|
|
263
|
-
> **intendToList**: `boolean`
|
|
263
|
+
> `optional` **intendToList**: `boolean`
|
|
264
264
|
|
|
265
265
|
If this is true, the list should be fetched, or re-fetched if arguments change.
|
|
266
266
|
|
|
267
|
-
###### intendToSubscribe
|
|
267
|
+
###### intendToSubscribe?
|
|
268
268
|
|
|
269
|
-
> **intendToSubscribe**: `boolean`
|
|
269
|
+
> `optional` **intendToSubscribe**: `boolean`
|
|
270
270
|
|
|
271
271
|
If this is true, the subscription should start or restart if arguments change.
|
|
272
272
|
|
|
@@ -276,15 +276,15 @@ If this is true, the subscription should start or restart if arguments change.
|
|
|
276
276
|
|
|
277
277
|
Arguments passed to the server for listing operations.
|
|
278
278
|
|
|
279
|
-
###### loading
|
|
279
|
+
###### loading?
|
|
280
280
|
|
|
281
|
-
> **loading**: `boolean`
|
|
281
|
+
> `optional` **loading**: `boolean`
|
|
282
282
|
|
|
283
283
|
Indicates if the list is currently loading.
|
|
284
284
|
|
|
285
|
-
###### objAndKeyForPkAndRule
|
|
285
|
+
###### objAndKeyForPkAndRule?
|
|
286
286
|
|
|
287
|
-
> **objAndKeyForPkAndRule**: `object`
|
|
287
|
+
> `optional` **objAndKeyForPkAndRule**: `object`
|
|
288
288
|
|
|
289
289
|
Maps each object pk and rule to a tuple consisting of the related object and its respective key, facilitating direct data manipulation.
|
|
290
290
|
|
|
@@ -316,9 +316,9 @@ The order of objects in the list.
|
|
|
316
316
|
|
|
317
317
|
The primary key field for the list objects.
|
|
318
318
|
|
|
319
|
-
###### relatedObjects
|
|
319
|
+
###### relatedObjects?
|
|
320
320
|
|
|
321
|
-
> **relatedObjects**: `object`
|
|
321
|
+
> `optional` **relatedObjects**: `object`
|
|
322
322
|
|
|
323
323
|
Stores computed references to related objects, allowing for dynamic access based on object pk and specific rules.
|
|
324
324
|
|
|
@@ -326,15 +326,15 @@ Stores computed references to related objects, allowing for dynamic access based
|
|
|
326
326
|
|
|
327
327
|
\[`pk`: `string`\]: `object`
|
|
328
328
|
|
|
329
|
-
###### relatedObjectsParentStateObjectsWatchRunning
|
|
329
|
+
###### relatedObjectsParentStateObjectsWatchRunning?
|
|
330
330
|
|
|
331
|
-
> **relatedObjectsParentStateObjectsWatchRunning**: `boolean`
|
|
331
|
+
> `optional` **relatedObjectsParentStateObjectsWatchRunning**: `boolean`
|
|
332
332
|
|
|
333
333
|
Flags whether the watch on parent state objects is currently active, ensuring updates trigger as needed.
|
|
334
334
|
|
|
335
|
-
###### relatedObjectsRules
|
|
335
|
+
###### relatedObjectsRules?
|
|
336
336
|
|
|
337
|
-
> **relatedObjectsRules**: `object`
|
|
337
|
+
> `optional` **relatedObjectsRules**: `object`
|
|
338
338
|
|
|
339
339
|
Defines the rules for establishing relationships, such as foreign key links and sorting orders.
|
|
340
340
|
|
|
@@ -342,15 +342,15 @@ Defines the rules for establishing relationships, such as foreign key links and
|
|
|
342
342
|
|
|
343
343
|
\[`rule`: `string`\]: [`ListRelatedRule`](listRelated.md#listrelatedrule)
|
|
344
344
|
|
|
345
|
-
###### relatedObjectsWatchRunning
|
|
345
|
+
###### relatedObjectsWatchRunning?
|
|
346
346
|
|
|
347
|
-
> **relatedObjectsWatchRunning**: `boolean`
|
|
347
|
+
> `optional` **relatedObjectsWatchRunning**: `boolean`
|
|
348
348
|
|
|
349
349
|
Indicates if watches on the related objects themselves are active, managing updates efficiently.
|
|
350
350
|
|
|
351
|
-
###### relatedRunning
|
|
351
|
+
###### relatedRunning?
|
|
352
352
|
|
|
353
|
-
> **relatedRunning**: `boolean`
|
|
353
|
+
> `optional` **relatedRunning**: `boolean`
|
|
354
354
|
|
|
355
355
|
Signals whether any computations related to object relationships are currently in progress.
|
|
356
356
|
|
|
@@ -366,27 +366,27 @@ Arguments passed to the server for retrieval operations.
|
|
|
366
366
|
|
|
367
367
|
Indicates if there are ongoing reactive updates.
|
|
368
368
|
|
|
369
|
-
###### subscribed
|
|
369
|
+
###### subscribed?
|
|
370
370
|
|
|
371
|
-
> **subscribed**: `boolean`
|
|
371
|
+
> `optional` **subscribed**: `boolean`
|
|
372
372
|
|
|
373
373
|
Whether the subscription is active.
|
|
374
374
|
|
|
375
|
-
###### subscriptionError
|
|
375
|
+
###### subscriptionError?
|
|
376
376
|
|
|
377
|
-
> **subscriptionError**: `Error`
|
|
377
|
+
> `optional` **subscriptionError**: `Error`
|
|
378
378
|
|
|
379
379
|
The error that occurred.
|
|
380
380
|
|
|
381
|
-
###### subscriptionErrored
|
|
381
|
+
###### subscriptionErrored?
|
|
382
382
|
|
|
383
|
-
> **subscriptionErrored**: `boolean`
|
|
383
|
+
> `optional` **subscriptionErrored**: `boolean`
|
|
384
384
|
|
|
385
385
|
Whether the subscription has errored.
|
|
386
386
|
|
|
387
|
-
###### subscriptionLoading
|
|
387
|
+
###### subscriptionLoading?
|
|
388
388
|
|
|
389
|
-
> **subscriptionLoading**: `boolean`
|
|
389
|
+
> `optional` **subscriptionLoading**: `boolean`
|
|
390
390
|
|
|
391
391
|
Whether the subscription is loading.
|
|
392
392
|
|
|
@@ -446,9 +446,9 @@ CRUD functions and their configurations for the list.
|
|
|
446
446
|
|
|
447
447
|
Arguments for the CRUD functions.
|
|
448
448
|
|
|
449
|
-
###### crud.list
|
|
449
|
+
###### crud.list?
|
|
450
450
|
|
|
451
|
-
> **list**: `Function`
|
|
451
|
+
> `optional` **list**: `Function`
|
|
452
452
|
|
|
453
453
|
Function to list objects.
|
|
454
454
|
|
|
@@ -464,9 +464,9 @@ The last error encountered.
|
|
|
464
464
|
|
|
465
465
|
Indicates if an error occurred during the last operation.
|
|
466
466
|
|
|
467
|
-
###### fkForPkAndRule
|
|
467
|
+
###### fkForPkAndRule?
|
|
468
468
|
|
|
469
|
-
> **fkForPkAndRule**: `object`
|
|
469
|
+
> `optional` **fkForPkAndRule**: `object`
|
|
470
470
|
|
|
471
471
|
Maintains computed references to the foreign keys for each object pk and rule, crucial for navigating complex data relationships.
|
|
472
472
|
|
|
@@ -474,15 +474,15 @@ Maintains computed references to the foreign keys for each object pk and rule, c
|
|
|
474
474
|
|
|
475
475
|
\[`pk`: `string`\]: `object`
|
|
476
476
|
|
|
477
|
-
###### intendToList
|
|
477
|
+
###### intendToList?
|
|
478
478
|
|
|
479
|
-
> **intendToList**: `boolean`
|
|
479
|
+
> `optional` **intendToList**: `boolean`
|
|
480
480
|
|
|
481
481
|
If this is true, the list should be fetched, or re-fetched if arguments change.
|
|
482
482
|
|
|
483
|
-
###### intendToSubscribe
|
|
483
|
+
###### intendToSubscribe?
|
|
484
484
|
|
|
485
|
-
> **intendToSubscribe**: `boolean`
|
|
485
|
+
> `optional` **intendToSubscribe**: `boolean`
|
|
486
486
|
|
|
487
487
|
If this is true, the subscription should start or restart if arguments change.
|
|
488
488
|
|
|
@@ -492,15 +492,15 @@ If this is true, the subscription should start or restart if arguments change.
|
|
|
492
492
|
|
|
493
493
|
Arguments passed to the server for listing operations.
|
|
494
494
|
|
|
495
|
-
###### loading
|
|
495
|
+
###### loading?
|
|
496
496
|
|
|
497
|
-
> **loading**: `boolean`
|
|
497
|
+
> `optional` **loading**: `boolean`
|
|
498
498
|
|
|
499
499
|
Indicates if the list is currently loading.
|
|
500
500
|
|
|
501
|
-
###### objAndKeyForPkAndRule
|
|
501
|
+
###### objAndKeyForPkAndRule?
|
|
502
502
|
|
|
503
|
-
> **objAndKeyForPkAndRule**: `object`
|
|
503
|
+
> `optional` **objAndKeyForPkAndRule**: `object`
|
|
504
504
|
|
|
505
505
|
Maps each object pk and rule to a tuple consisting of the related object and its respective key, facilitating direct data manipulation.
|
|
506
506
|
|
|
@@ -532,9 +532,9 @@ The order of objects in the list.
|
|
|
532
532
|
|
|
533
533
|
The primary key field for the list objects.
|
|
534
534
|
|
|
535
|
-
###### relatedObjects
|
|
535
|
+
###### relatedObjects?
|
|
536
536
|
|
|
537
|
-
> **relatedObjects**: `object`
|
|
537
|
+
> `optional` **relatedObjects**: `object`
|
|
538
538
|
|
|
539
539
|
Stores computed references to related objects, allowing for dynamic access based on object pk and specific rules.
|
|
540
540
|
|
|
@@ -542,15 +542,15 @@ Stores computed references to related objects, allowing for dynamic access based
|
|
|
542
542
|
|
|
543
543
|
\[`pk`: `string`\]: `object`
|
|
544
544
|
|
|
545
|
-
###### relatedObjectsParentStateObjectsWatchRunning
|
|
545
|
+
###### relatedObjectsParentStateObjectsWatchRunning?
|
|
546
546
|
|
|
547
|
-
> **relatedObjectsParentStateObjectsWatchRunning**: `boolean`
|
|
547
|
+
> `optional` **relatedObjectsParentStateObjectsWatchRunning**: `boolean`
|
|
548
548
|
|
|
549
549
|
Flags whether the watch on parent state objects is currently active, ensuring updates trigger as needed.
|
|
550
550
|
|
|
551
|
-
###### relatedObjectsRules
|
|
551
|
+
###### relatedObjectsRules?
|
|
552
552
|
|
|
553
|
-
> **relatedObjectsRules**: `object`
|
|
553
|
+
> `optional` **relatedObjectsRules**: `object`
|
|
554
554
|
|
|
555
555
|
Defines the rules for establishing relationships, such as foreign key links and sorting orders.
|
|
556
556
|
|
|
@@ -558,15 +558,15 @@ Defines the rules for establishing relationships, such as foreign key links and
|
|
|
558
558
|
|
|
559
559
|
\[`rule`: `string`\]: [`ListRelatedRule`](listRelated.md#listrelatedrule)
|
|
560
560
|
|
|
561
|
-
###### relatedObjectsWatchRunning
|
|
561
|
+
###### relatedObjectsWatchRunning?
|
|
562
562
|
|
|
563
|
-
> **relatedObjectsWatchRunning**: `boolean`
|
|
563
|
+
> `optional` **relatedObjectsWatchRunning**: `boolean`
|
|
564
564
|
|
|
565
565
|
Indicates if watches on the related objects themselves are active, managing updates efficiently.
|
|
566
566
|
|
|
567
|
-
###### relatedRunning
|
|
567
|
+
###### relatedRunning?
|
|
568
568
|
|
|
569
|
-
> **relatedRunning**: `boolean`
|
|
569
|
+
> `optional` **relatedRunning**: `boolean`
|
|
570
570
|
|
|
571
571
|
Signals whether any computations related to object relationships are currently in progress.
|
|
572
572
|
|
|
@@ -582,27 +582,27 @@ Arguments passed to the server for retrieval operations.
|
|
|
582
582
|
|
|
583
583
|
Indicates if there are ongoing reactive updates.
|
|
584
584
|
|
|
585
|
-
###### subscribed
|
|
585
|
+
###### subscribed?
|
|
586
586
|
|
|
587
|
-
> **subscribed**: `boolean`
|
|
587
|
+
> `optional` **subscribed**: `boolean`
|
|
588
588
|
|
|
589
589
|
Whether the subscription is active.
|
|
590
590
|
|
|
591
|
-
###### subscriptionError
|
|
591
|
+
###### subscriptionError?
|
|
592
592
|
|
|
593
|
-
> **subscriptionError**: `Error`
|
|
593
|
+
> `optional` **subscriptionError**: `Error`
|
|
594
594
|
|
|
595
595
|
The error that occurred.
|
|
596
596
|
|
|
597
|
-
###### subscriptionErrored
|
|
597
|
+
###### subscriptionErrored?
|
|
598
598
|
|
|
599
|
-
> **subscriptionErrored**: `boolean`
|
|
599
|
+
> `optional` **subscriptionErrored**: `boolean`
|
|
600
600
|
|
|
601
601
|
Whether the subscription has errored.
|
|
602
602
|
|
|
603
|
-
###### subscriptionLoading
|
|
603
|
+
###### subscriptionLoading?
|
|
604
604
|
|
|
605
|
-
> **subscriptionLoading**: `boolean`
|
|
605
|
+
> `optional` **subscriptionLoading**: `boolean`
|
|
606
606
|
|
|
607
607
|
Whether the subscription is loading.
|
|
608
608
|
|
|
@@ -638,7 +638,7 @@ Whether the parent state objects watch is running.
|
|
|
638
638
|
|
|
639
639
|
##### calculatedObjectsRules
|
|
640
640
|
|
|
641
|
-
> **calculatedObjectsRules**: `Ref`\<`object`\>
|
|
641
|
+
> **calculatedObjectsRules**: `Ref`\<`object`, `object`\>
|
|
642
642
|
|
|
643
643
|
The rules for the calculated objects.
|
|
644
644
|
|
|
@@ -656,7 +656,7 @@ Whether the calculated properties are running.
|
|
|
656
656
|
|
|
657
657
|
##### running
|
|
658
658
|
|
|
659
|
-
> **running**: `Ref`\<`boolean`\>
|
|
659
|
+
> **running**: `Ref`\<`boolean`, `boolean`\>
|
|
660
660
|
|
|
661
661
|
Whether the list is running.
|
|
662
662
|
|
|
@@ -672,7 +672,7 @@ Whether the list is running.
|
|
|
672
672
|
|
|
673
673
|
### ListCalculatedParentRawState
|
|
674
674
|
|
|
675
|
-
> **ListCalculatedParentRawState**\<\>: [`
|
|
675
|
+
> **ListCalculatedParentRawState**\<\>: [`ListInstanceRawState`](listInstance.md#listinstancerawstate) & `Partial`\<[`ListSubscriptionRawState`](listSubscription.md#listsubscriptionrawstate)\> & `Partial`\<[`ListRelatedRawState`](listRelated.md#listrelatedrawstate)\>
|
|
676
676
|
|
|
677
677
|
#### Type Parameters
|
|
678
678
|
|
|
@@ -714,7 +714,9 @@ consistency in dynamic UIs.
|
|
|
714
714
|
|
|
715
715
|
#### Parameters
|
|
716
716
|
|
|
717
|
-
|
|
717
|
+
##### options
|
|
718
|
+
|
|
719
|
+
[`ListCalculatedOptions`](listCalculated.md#listcalculatedoptions)
|
|
718
720
|
|
|
719
721
|
Configuration options including the parent state and rules for dynamically
|
|
720
722
|
generating calculated properties. This setup allows the system to handle calculations as part of the list management
|
|
@@ -731,7 +733,7 @@ Configuration options including the parent state and rules for dynamically
|
|
|
731
733
|
|
|
732
734
|
```vue
|
|
733
735
|
<script setup>
|
|
734
|
-
import { useListSubscription,
|
|
736
|
+
import { useListSubscription, useListCalculated } from "@arrai-innovations/reactive-helpers";
|
|
735
737
|
import { reactive, toRef } from "vue";
|
|
736
738
|
|
|
737
739
|
const listSubscriptionProps = reactive({
|
|
@@ -743,7 +745,7 @@ const listSubscriptionProps = reactive({
|
|
|
743
745
|
intendToList: true,
|
|
744
746
|
});
|
|
745
747
|
const listSubscription = useListSubscription(listSubscriptionProps);
|
|
746
|
-
const
|
|
748
|
+
const listCalculatedProps = reactive({
|
|
747
749
|
parentState: listSubscription.state,
|
|
748
750
|
computedObjectsRules: {
|
|
749
751
|
someRule: (object, relatedObjects, calculatedObjects) => {
|
|
@@ -755,7 +757,7 @@ const listComputedProps = reactive({
|
|
|
755
757
|
}
|
|
756
758
|
},
|
|
757
759
|
});
|
|
758
|
-
const
|
|
760
|
+
const listCalculated = useListCalculated(listCalculatedProps);
|
|
759
761
|
</script>
|
|
760
762
|
<template>
|
|
761
763
|
<ul>
|
|
@@ -764,7 +766,7 @@ const listComputed = useListComputed(listComputedProps);
|
|
|
764
766
|
{{ obj }}
|
|
765
767
|
<div>
|
|
766
768
|
<!-- the computed object or objects based on the rule -->
|
|
767
|
-
{{
|
|
769
|
+
{{ listCalculated.state.computedObjects[obj.pk].someRule }}
|
|
768
770
|
</div>
|
|
769
771
|
</li>
|
|
770
772
|
</ul>
|
|
@@ -781,7 +783,7 @@ A composable function to create multiple list calculated objects.
|
|
|
781
783
|
|
|
782
784
|
#### Parameters
|
|
783
785
|
|
|
784
|
-
|
|
786
|
+
##### listCalculatedArgs
|
|
785
787
|
|
|
786
788
|
The arguments for the list calculated objects.
|
|
787
789
|
|