@arrai-innovations/reactive-helpers 15.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/config/listCrud.js +12 -4
- package/config/objectCrud.js +2 -2
- package/docs/README.md +2 -1
- package/docs/config/listCrud.md +111 -39
- package/docs/config/objectCrud.md +70 -32
- 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 +53 -37
- 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 +23 -11
- package/docs/use/object.md +87 -61
- package/docs/use/objectCalculated.md +124 -98
- package/docs/use/objectInstance.md +148 -70
- package/docs/use/objectRelated.md +101 -75
- package/docs/use/objectSubscription.md +60 -38
- 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 +59 -0
- 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/index.js +1 -0
- package/package.json +4 -3
- package/tests/unit/use/listInstance.spec.js +54 -31
- 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/tsconfig.json +2 -2
- package/typedoc.json +0 -1
- package/use/cancellableIntent.js +21 -2
- package/use/list.js +3 -4
- package/use/listCalculated.js +6 -6
- package/use/listInstance.js +6 -6
- package/use/listRelated.js +6 -3
- package/use/listSearch.js +1 -1
- package/use/loadingError.js +5 -1
- package/use/objectCalculated.js +42 -38
- package/use/objectInstance.js +9 -9
- package/use/objectRelated.js +6 -3
- package/utils/classes.js +127 -116
- package/utils/keepAliveTry.js +28 -0
package/.husky/commit-msg
CHANGED
package/.husky/pre-commit
CHANGED
package/config/listCrud.js
CHANGED
|
@@ -66,19 +66,27 @@ const defaultCrud = {
|
|
|
66
66
|
*/
|
|
67
67
|
|
|
68
68
|
/**
|
|
69
|
-
* @typedef {
|
|
69
|
+
* @typedef {object} ExecuteActionFnArgs
|
|
70
|
+
* @property {object} crudArgs - The arguments to be passed to the crud functions.
|
|
71
|
+
* @property {string[]} pks - The ids of the objects to be acted upon.
|
|
72
|
+
* @property {string} pkKey - The key name of the primary key.
|
|
73
|
+
* @property {string} action - The action to execute.
|
|
74
|
+
*/
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* @typedef {(ListFnArgs)=>Promise<boolean> & { cancel: () => Promise<void>|void }} ListFn - The list function to get a list of items, returning a boolean indicating success.
|
|
70
78
|
*/
|
|
71
79
|
|
|
72
80
|
/**
|
|
73
|
-
* @typedef {(DeleteFnArgs)=>void} BulkDeleteFn
|
|
81
|
+
* @typedef {(DeleteFnArgs)=>Promise<boolean> & { cancel: () => Promise<void>|void }} BulkDeleteFn - The delete function to bulk delete a list of items.
|
|
74
82
|
*/
|
|
75
83
|
|
|
76
84
|
/**
|
|
77
|
-
* @typedef {(SubscribeFnArgs)=>void} SubscribeFn
|
|
85
|
+
* @typedef {(SubscribeFnArgs)=>Promise<boolean> & { cancel: () => Promise<void>|void }} SubscribeFn - The subscribe function to set up a subscription to a list of items.
|
|
78
86
|
*/
|
|
79
87
|
|
|
80
88
|
/**
|
|
81
|
-
* @typedef {(ExecuteActionFnArgs)=>void} ExecuteActionFn
|
|
89
|
+
* @typedef {(ExecuteActionFnArgs)=>Promise<import('./objectCrud.js').ResponseData|false> & { cancel: () => Promise<void>|void }} ExecuteActionFn - The function to execute a certain action on a list of items, returning the response data or false.
|
|
82
90
|
*/
|
|
83
91
|
|
|
84
92
|
/**
|
package/config/objectCrud.js
CHANGED
|
@@ -79,7 +79,7 @@ const defaultCrud = {
|
|
|
79
79
|
*/
|
|
80
80
|
|
|
81
81
|
/**
|
|
82
|
-
* @typedef {Promise<object|string>} ResponseData
|
|
82
|
+
* @typedef {Promise<object|string> & { cancel: () => Promise<void>|void }} ResponseData
|
|
83
83
|
*/
|
|
84
84
|
|
|
85
85
|
/**
|
|
@@ -91,7 +91,7 @@ const defaultCrud = {
|
|
|
91
91
|
* @property {(UpdateDetailArgs)=>ResponseData} [update] - A function to be used instead of the default crud update function.
|
|
92
92
|
* @property {(DeleteDetailArgs)=>ResponseData} [delete] - A function to be used instead of the default crud delete function.
|
|
93
93
|
* @property {(PartialDetailArgs)=>ResponseData} [patch] - A function to be used instead of the default crud patch function.
|
|
94
|
-
* @property {(SubscribeArgs)=>void} [subscribe] - A function to be used instead of the default crud subscribe function.
|
|
94
|
+
* @property {(SubscribeArgs)=>void & { cancel: () => Promise<void>|void }} [subscribe] - A function to be used instead of the default crud subscribe function.
|
|
95
95
|
*/
|
|
96
96
|
|
|
97
97
|
/**
|
package/docs/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
**@arrai-innovations/reactive-helpers**
|
|
1
|
+
**@arrai-innovations/reactive-helpers**
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
- [utils/deleteKey](utils/deleteKey.md)
|
|
36
36
|
- [utils/flattenPaths](utils/flattenPaths.md)
|
|
37
37
|
- [utils/getFakePk](utils/getFakePk.md)
|
|
38
|
+
- [utils/keepAliveTry](utils/keepAliveTry.md)
|
|
38
39
|
- [utils/keyDiff](utils/keyDiff.md)
|
|
39
40
|
- [utils/loadingCombine](utils/loadingCombine.md)
|
|
40
41
|
- [utils/proxyRunning](utils/proxyRunning.md)
|
package/docs/config/listCrud.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[**@arrai-innovations/reactive-helpers**](../README.md)
|
|
1
|
+
[**@arrai-innovations/reactive-helpers**](../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
@@ -32,13 +32,43 @@ The ids of the objects to be deleted.
|
|
|
32
32
|
|
|
33
33
|
***
|
|
34
34
|
|
|
35
|
+
### ExecuteActionFnArgs
|
|
36
|
+
|
|
37
|
+
#### Properties
|
|
38
|
+
|
|
39
|
+
##### action
|
|
40
|
+
|
|
41
|
+
> **action**: `string`
|
|
42
|
+
|
|
43
|
+
The action to execute.
|
|
44
|
+
|
|
45
|
+
##### crudArgs
|
|
46
|
+
|
|
47
|
+
> **crudArgs**: `any`
|
|
48
|
+
|
|
49
|
+
The arguments to be passed to the crud functions.
|
|
50
|
+
|
|
51
|
+
##### pkKey
|
|
52
|
+
|
|
53
|
+
> **pkKey**: `string`
|
|
54
|
+
|
|
55
|
+
The key name of the primary key.
|
|
56
|
+
|
|
57
|
+
##### pks
|
|
58
|
+
|
|
59
|
+
> **pks**: `string`[]
|
|
60
|
+
|
|
61
|
+
The ids of the objects to be acted upon.
|
|
62
|
+
|
|
63
|
+
***
|
|
64
|
+
|
|
35
65
|
### ListCrudArgs
|
|
36
66
|
|
|
37
67
|
#### Properties
|
|
38
68
|
|
|
39
|
-
##### args
|
|
69
|
+
##### args?
|
|
40
70
|
|
|
41
|
-
> **args**: `any`
|
|
71
|
+
> `optional` **args**: `any`
|
|
42
72
|
|
|
43
73
|
The default arguments for the crud functions.
|
|
44
74
|
|
|
@@ -48,27 +78,27 @@ The default arguments for the crud functions.
|
|
|
48
78
|
|
|
49
79
|
#### Properties
|
|
50
80
|
|
|
51
|
-
##### bulkDelete
|
|
81
|
+
##### bulkDelete?
|
|
52
82
|
|
|
53
|
-
> **bulkDelete**: [`BulkDeleteFn`](listCrud.md#bulkdeletefn)
|
|
83
|
+
> `optional` **bulkDelete**: [`BulkDeleteFn`](listCrud.md#bulkdeletefn)
|
|
54
84
|
|
|
55
85
|
The delete function to bulk delete a list of items.
|
|
56
86
|
|
|
57
|
-
##### executeAction
|
|
87
|
+
##### executeAction?
|
|
58
88
|
|
|
59
|
-
> **executeAction**: [`ExecuteActionFn`](listCrud.md#executeactionfn)
|
|
89
|
+
> `optional` **executeAction**: [`ExecuteActionFn`](listCrud.md#executeactionfn)
|
|
60
90
|
|
|
61
91
|
The function to execute a certain action on a list of items.
|
|
62
92
|
|
|
63
|
-
##### list
|
|
93
|
+
##### list?
|
|
64
94
|
|
|
65
|
-
> **list**: [`ListFn`](listCrud.md#listfn)
|
|
95
|
+
> `optional` **list**: [`ListFn`](listCrud.md#listfn)
|
|
66
96
|
|
|
67
97
|
The list function to get a list of items.
|
|
68
98
|
|
|
69
|
-
##### subscribe
|
|
99
|
+
##### subscribe?
|
|
70
100
|
|
|
71
|
-
> **subscribe**: [`SubscribeFn`](listCrud.md#subscribefn)
|
|
101
|
+
> `optional` **subscribe**: [`SubscribeFn`](listCrud.md#subscribefn)
|
|
72
102
|
|
|
73
103
|
The subscribe function to get a subscription to a list of items.
|
|
74
104
|
|
|
@@ -86,7 +116,7 @@ The arguments to be passed to the crud functions.
|
|
|
86
116
|
|
|
87
117
|
##### isCancelled
|
|
88
118
|
|
|
89
|
-
> **isCancelled**: `Readonly`\<`Ref`\<`boolean`\>\>
|
|
119
|
+
> **isCancelled**: `Readonly`\<`Ref`\<`boolean`, `boolean`\>\>
|
|
90
120
|
|
|
91
121
|
A ref to a boolean indicating whether the request has
|
|
92
122
|
been cancelled.
|
|
@@ -179,49 +209,61 @@ The method to call when new data is received.
|
|
|
179
209
|
|
|
180
210
|
### BulkDeleteFn()
|
|
181
211
|
|
|
182
|
-
> **BulkDeleteFn**\<\>: (`DeleteFnArgs`) => `
|
|
212
|
+
> **BulkDeleteFn**\<\>: (`DeleteFnArgs`) => `Promise`\<`boolean`\> & `object`
|
|
213
|
+
|
|
214
|
+
The delete function to bulk delete a list of items.
|
|
183
215
|
|
|
184
216
|
#### Type Parameters
|
|
185
217
|
|
|
186
218
|
#### Parameters
|
|
187
219
|
|
|
188
|
-
|
|
220
|
+
##### DeleteFnArgs
|
|
221
|
+
|
|
222
|
+
`any`
|
|
189
223
|
|
|
190
224
|
#### Returns
|
|
191
225
|
|
|
192
|
-
`
|
|
226
|
+
`Promise`\<`boolean`\> & `object`
|
|
193
227
|
|
|
194
228
|
***
|
|
195
229
|
|
|
196
230
|
### ExecuteActionFn()
|
|
197
231
|
|
|
198
|
-
> **ExecuteActionFn**\<\>: (`ExecuteActionFnArgs`) => `
|
|
232
|
+
> **ExecuteActionFn**\<\>: (`ExecuteActionFnArgs`) => `Promise`\<[`ResponseData`](objectCrud.md#responsedata) \| `false`\> & `object`
|
|
233
|
+
|
|
234
|
+
The function to execute a certain action on a list of items, returning the response data or false.
|
|
199
235
|
|
|
200
236
|
#### Type Parameters
|
|
201
237
|
|
|
202
238
|
#### Parameters
|
|
203
239
|
|
|
204
|
-
|
|
240
|
+
##### ExecuteActionFnArgs
|
|
241
|
+
|
|
242
|
+
`any`
|
|
205
243
|
|
|
206
244
|
#### Returns
|
|
207
245
|
|
|
208
|
-
`
|
|
246
|
+
`Promise`\<[`ResponseData`](objectCrud.md#responsedata) \| `false`\> & `object`
|
|
209
247
|
|
|
210
248
|
***
|
|
211
249
|
|
|
212
250
|
### ListFn()
|
|
213
251
|
|
|
214
|
-
> **ListFn**\<\>: (`ListFnArgs`) => `
|
|
252
|
+
> **ListFn**\<\>: (`ListFnArgs`) => `Promise`\<`boolean`\> & `object`
|
|
253
|
+
|
|
254
|
+
The list function to get a list of items, returning a boolean indicating success.
|
|
215
255
|
|
|
216
256
|
#### Type Parameters
|
|
217
257
|
|
|
218
258
|
#### Parameters
|
|
219
259
|
|
|
220
|
-
|
|
260
|
+
##### ListFnArgs
|
|
261
|
+
|
|
262
|
+
`any`
|
|
221
263
|
|
|
222
264
|
#### Returns
|
|
223
265
|
|
|
224
|
-
`
|
|
266
|
+
`Promise`\<`boolean`\> & `object`
|
|
225
267
|
|
|
226
268
|
***
|
|
227
269
|
|
|
@@ -233,9 +275,13 @@ The method to call when new data is received.
|
|
|
233
275
|
|
|
234
276
|
#### Parameters
|
|
235
277
|
|
|
236
|
-
|
|
278
|
+
##### newObjects
|
|
279
|
+
|
|
280
|
+
[`ListObject`](../use/listInstance.md#listobject)
|
|
237
281
|
|
|
238
|
-
|
|
282
|
+
##### paginationInfo
|
|
283
|
+
|
|
284
|
+
[`PaginateInfo`](listCrud.md#paginateinfo) | `undefined`
|
|
239
285
|
|
|
240
286
|
#### Returns
|
|
241
287
|
|
|
@@ -245,17 +291,21 @@ The method to call when new data is received.
|
|
|
245
291
|
|
|
246
292
|
### SubscribeFn()
|
|
247
293
|
|
|
248
|
-
> **SubscribeFn**\<\>: (`SubscribeFnArgs`) => `
|
|
294
|
+
> **SubscribeFn**\<\>: (`SubscribeFnArgs`) => `Promise`\<`boolean`\> & `object`
|
|
295
|
+
|
|
296
|
+
The subscribe function to set up a subscription to a list of items.
|
|
249
297
|
|
|
250
298
|
#### Type Parameters
|
|
251
299
|
|
|
252
300
|
#### Parameters
|
|
253
301
|
|
|
254
|
-
|
|
302
|
+
##### SubscribeFnArgs
|
|
303
|
+
|
|
304
|
+
`any`
|
|
255
305
|
|
|
256
306
|
#### Returns
|
|
257
307
|
|
|
258
|
-
`
|
|
308
|
+
`Promise`\<`boolean`\> & `object`
|
|
259
309
|
|
|
260
310
|
***
|
|
261
311
|
|
|
@@ -267,9 +317,13 @@ The method to call when new data is received.
|
|
|
267
317
|
|
|
268
318
|
#### Parameters
|
|
269
319
|
|
|
270
|
-
|
|
320
|
+
##### newOrUpdatedOrDeleteObject
|
|
321
|
+
|
|
322
|
+
[`ListObject`](../use/listInstance.md#listobject) | `string`
|
|
323
|
+
|
|
324
|
+
##### action
|
|
271
325
|
|
|
272
|
-
|
|
326
|
+
`"create"` | `"update"` | `"delete"`
|
|
273
327
|
|
|
274
328
|
#### Returns
|
|
275
329
|
|
|
@@ -285,43 +339,59 @@ Get the previously set list and subscribe functions for the default crud.
|
|
|
285
339
|
|
|
286
340
|
#### Parameters
|
|
287
341
|
|
|
288
|
-
|
|
342
|
+
##### reactiveCrud
|
|
289
343
|
|
|
290
344
|
The reactive crud object, which will be mutated.
|
|
291
345
|
|
|
292
|
-
|
|
346
|
+
###### reactiveCrud.args
|
|
347
|
+
|
|
348
|
+
`any`
|
|
293
349
|
|
|
294
350
|
The default arguments for the crud functions.
|
|
295
351
|
|
|
296
|
-
|
|
352
|
+
###### reactiveCrud.bulkDelete
|
|
353
|
+
|
|
354
|
+
[`BulkDeleteFn`](listCrud.md#bulkdeletefn)
|
|
297
355
|
|
|
298
356
|
The delete function to bulk delete a list of items.
|
|
299
357
|
|
|
300
|
-
|
|
358
|
+
###### reactiveCrud.executeAction
|
|
359
|
+
|
|
360
|
+
[`ExecuteActionFn`](listCrud.md#executeactionfn)
|
|
301
361
|
|
|
302
362
|
The function to execute a certain action on a list of items.
|
|
303
363
|
|
|
304
|
-
|
|
364
|
+
###### reactiveCrud.list
|
|
365
|
+
|
|
366
|
+
[`ListFn`](listCrud.md#listfn)
|
|
305
367
|
|
|
306
368
|
The list function to get a list of items.
|
|
307
369
|
|
|
308
|
-
|
|
370
|
+
###### reactiveCrud.subscribe
|
|
371
|
+
|
|
372
|
+
[`SubscribeFn`](listCrud.md#subscribefn)
|
|
309
373
|
|
|
310
374
|
The subscribe function to get a subscription to a list of items.
|
|
311
375
|
|
|
312
|
-
|
|
376
|
+
##### options
|
|
313
377
|
|
|
314
378
|
The options for the default crud.
|
|
315
379
|
|
|
316
|
-
|
|
380
|
+
###### options.functions
|
|
381
|
+
|
|
382
|
+
[`ListCrudFunctions`](listCrud.md#listcrudfunctions) & [`ListCrudArgs`](listCrud.md#listcrudargs)
|
|
317
383
|
|
|
318
384
|
The functions to set for the crud.
|
|
319
385
|
|
|
320
|
-
|
|
386
|
+
###### options.props
|
|
387
|
+
|
|
388
|
+
`object`
|
|
321
389
|
|
|
322
390
|
The props to set for the crud.
|
|
323
391
|
|
|
324
|
-
|
|
392
|
+
###### options.props.crudArgs
|
|
393
|
+
|
|
394
|
+
`any`
|
|
325
395
|
|
|
326
396
|
#### Returns
|
|
327
397
|
|
|
@@ -337,7 +407,9 @@ Set the list and subscribe functions for the default crud.
|
|
|
337
407
|
|
|
338
408
|
#### Parameters
|
|
339
409
|
|
|
340
|
-
|
|
410
|
+
##### options
|
|
411
|
+
|
|
412
|
+
[`ListCrudFunctions`](listCrud.md#listcrudfunctions) & `Partial`\<[`ListCrudArgs`](listCrud.md#listcrudargs)\>
|
|
341
413
|
|
|
342
414
|
The options for the default crud.
|
|
343
415
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[**@arrai-innovations/reactive-helpers**](../README.md)
|
|
1
|
+
[**@arrai-innovations/reactive-helpers**](../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
@@ -72,9 +72,9 @@ The arguments to be passed to the retrieve function.
|
|
|
72
72
|
|
|
73
73
|
#### Properties
|
|
74
74
|
|
|
75
|
-
##### args
|
|
75
|
+
##### args?
|
|
76
76
|
|
|
77
|
-
> **args**: `any`
|
|
77
|
+
> `optional` **args**: `any`
|
|
78
78
|
|
|
79
79
|
The arguments to be passed to the crud functions.
|
|
80
80
|
|
|
@@ -84,85 +84,97 @@ The arguments to be passed to the crud functions.
|
|
|
84
84
|
|
|
85
85
|
#### Properties
|
|
86
86
|
|
|
87
|
-
##### create()
|
|
87
|
+
##### create()?
|
|
88
88
|
|
|
89
|
-
> **create**: (`CreateDetailArgs`) => [`ResponseData`](objectCrud.md#responsedata)
|
|
89
|
+
> `optional` **create**: (`CreateDetailArgs`) => [`ResponseData`](objectCrud.md#responsedata)
|
|
90
90
|
|
|
91
91
|
A function to be used instead of the default crud create function.
|
|
92
92
|
|
|
93
93
|
###### Parameters
|
|
94
94
|
|
|
95
|
-
|
|
95
|
+
###### CreateDetailArgs
|
|
96
|
+
|
|
97
|
+
`any`
|
|
96
98
|
|
|
97
99
|
###### Returns
|
|
98
100
|
|
|
99
101
|
[`ResponseData`](objectCrud.md#responsedata)
|
|
100
102
|
|
|
101
|
-
##### delete()
|
|
103
|
+
##### delete()?
|
|
102
104
|
|
|
103
|
-
> **delete**: (`DeleteDetailArgs`) => [`ResponseData`](objectCrud.md#responsedata)
|
|
105
|
+
> `optional` **delete**: (`DeleteDetailArgs`) => [`ResponseData`](objectCrud.md#responsedata)
|
|
104
106
|
|
|
105
107
|
A function to be used instead of the default crud delete function.
|
|
106
108
|
|
|
107
109
|
###### Parameters
|
|
108
110
|
|
|
109
|
-
|
|
111
|
+
###### DeleteDetailArgs
|
|
112
|
+
|
|
113
|
+
`any`
|
|
110
114
|
|
|
111
115
|
###### Returns
|
|
112
116
|
|
|
113
117
|
[`ResponseData`](objectCrud.md#responsedata)
|
|
114
118
|
|
|
115
|
-
##### patch()
|
|
119
|
+
##### patch()?
|
|
116
120
|
|
|
117
|
-
> **patch**: (`PartialDetailArgs`) => [`ResponseData`](objectCrud.md#responsedata)
|
|
121
|
+
> `optional` **patch**: (`PartialDetailArgs`) => [`ResponseData`](objectCrud.md#responsedata)
|
|
118
122
|
|
|
119
123
|
A function to be used instead of the default crud patch function.
|
|
120
124
|
|
|
121
125
|
###### Parameters
|
|
122
126
|
|
|
123
|
-
|
|
127
|
+
###### PartialDetailArgs
|
|
128
|
+
|
|
129
|
+
`any`
|
|
124
130
|
|
|
125
131
|
###### Returns
|
|
126
132
|
|
|
127
133
|
[`ResponseData`](objectCrud.md#responsedata)
|
|
128
134
|
|
|
129
|
-
##### retrieve()
|
|
135
|
+
##### retrieve()?
|
|
130
136
|
|
|
131
|
-
> **retrieve**: (`RetrieveDetailArgs`) => [`ResponseData`](objectCrud.md#responsedata)
|
|
137
|
+
> `optional` **retrieve**: (`RetrieveDetailArgs`) => [`ResponseData`](objectCrud.md#responsedata)
|
|
132
138
|
|
|
133
139
|
A function to be used instead of the default crud retrieve function.
|
|
134
140
|
|
|
135
141
|
###### Parameters
|
|
136
142
|
|
|
137
|
-
|
|
143
|
+
###### RetrieveDetailArgs
|
|
144
|
+
|
|
145
|
+
`any`
|
|
138
146
|
|
|
139
147
|
###### Returns
|
|
140
148
|
|
|
141
149
|
[`ResponseData`](objectCrud.md#responsedata)
|
|
142
150
|
|
|
143
|
-
##### subscribe()
|
|
151
|
+
##### subscribe()?
|
|
144
152
|
|
|
145
|
-
> **subscribe**: (`SubscribeArgs`) => `void`
|
|
153
|
+
> `optional` **subscribe**: (`SubscribeArgs`) => `void` & `object`
|
|
146
154
|
|
|
147
155
|
A function to be used instead of the default crud subscribe function.
|
|
148
156
|
|
|
149
157
|
###### Parameters
|
|
150
158
|
|
|
151
|
-
|
|
159
|
+
###### SubscribeArgs
|
|
160
|
+
|
|
161
|
+
`any`
|
|
152
162
|
|
|
153
163
|
###### Returns
|
|
154
164
|
|
|
155
|
-
`void`
|
|
165
|
+
`void` & `object`
|
|
156
166
|
|
|
157
|
-
##### update()
|
|
167
|
+
##### update()?
|
|
158
168
|
|
|
159
|
-
> **update**: (`UpdateDetailArgs`) => [`ResponseData`](objectCrud.md#responsedata)
|
|
169
|
+
> `optional` **update**: (`UpdateDetailArgs`) => [`ResponseData`](objectCrud.md#responsedata)
|
|
160
170
|
|
|
161
171
|
A function to be used instead of the default crud update function.
|
|
162
172
|
|
|
163
173
|
###### Parameters
|
|
164
174
|
|
|
165
|
-
|
|
175
|
+
###### UpdateDetailArgs
|
|
176
|
+
|
|
177
|
+
`any`
|
|
166
178
|
|
|
167
179
|
###### Returns
|
|
168
180
|
|
|
@@ -248,9 +260,13 @@ The callback to be called when the object is updated.
|
|
|
248
260
|
|
|
249
261
|
###### Parameters
|
|
250
262
|
|
|
251
|
-
|
|
263
|
+
###### data
|
|
264
|
+
|
|
265
|
+
[`CrudObject`](../use/objectInstance.md#crudobject)
|
|
266
|
+
|
|
267
|
+
###### action
|
|
252
268
|
|
|
253
|
-
|
|
269
|
+
`string`
|
|
254
270
|
|
|
255
271
|
###### Returns
|
|
256
272
|
|
|
@@ -322,7 +338,17 @@ The arguments to be passed to the retrieve function.
|
|
|
322
338
|
|
|
323
339
|
### ResponseData
|
|
324
340
|
|
|
325
|
-
> **ResponseData**\<\>: `Promise`\<`object` \| `string`\>
|
|
341
|
+
> **ResponseData**\<\>: `Promise`\<`object` \| `string`\> & `object`
|
|
342
|
+
|
|
343
|
+
#### Type declaration
|
|
344
|
+
|
|
345
|
+
##### cancel()
|
|
346
|
+
|
|
347
|
+
> **cancel**: () => `Promise`\<`void`\> \| `void`
|
|
348
|
+
|
|
349
|
+
###### Returns
|
|
350
|
+
|
|
351
|
+
`Promise`\<`void`\> \| `void`
|
|
326
352
|
|
|
327
353
|
#### Type Parameters
|
|
328
354
|
|
|
@@ -336,25 +362,35 @@ Get the previously set object crud functions.
|
|
|
336
362
|
|
|
337
363
|
#### Parameters
|
|
338
364
|
|
|
339
|
-
|
|
365
|
+
##### reactiveCrud
|
|
366
|
+
|
|
367
|
+
`any`
|
|
340
368
|
|
|
341
369
|
The reactive object you want to add the resulting crud to.
|
|
342
370
|
|
|
343
|
-
|
|
371
|
+
##### options
|
|
344
372
|
|
|
345
373
|
The options for the reactive crud object.
|
|
346
374
|
|
|
347
|
-
|
|
375
|
+
###### options.functions
|
|
376
|
+
|
|
377
|
+
[`ObjectCrudFunctions`](objectCrud.md#objectcrudfunctions)
|
|
348
378
|
|
|
349
379
|
Any functions to override the default crud functions.
|
|
350
380
|
|
|
351
|
-
|
|
381
|
+
###### options.props
|
|
382
|
+
|
|
383
|
+
`object`
|
|
352
384
|
|
|
353
385
|
The props with any passed crudArgs.
|
|
354
386
|
|
|
355
|
-
|
|
387
|
+
###### options.props.crudArgs
|
|
388
|
+
|
|
389
|
+
`object`
|
|
356
390
|
|
|
357
|
-
|
|
391
|
+
###### options.props.crudArgs.args
|
|
392
|
+
|
|
393
|
+
`any`
|
|
358
394
|
|
|
359
395
|
The arguments to be passed to the crud functions.
|
|
360
396
|
|
|
@@ -376,7 +412,9 @@ Set the object crud functions.
|
|
|
376
412
|
|
|
377
413
|
#### Parameters
|
|
378
414
|
|
|
379
|
-
|
|
415
|
+
##### options
|
|
416
|
+
|
|
417
|
+
[`ObjectCrudArgs`](objectCrud.md#objectcrudargs)
|
|
380
418
|
|
|
381
419
|
The options for the object crud functions.
|
|
382
420
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[**@arrai-innovations/reactive-helpers**](../README.md)
|
|
1
|
+
[**@arrai-innovations/reactive-helpers**](../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
@@ -62,21 +62,21 @@ The function that returns a promise that can be cancelled.
|
|
|
62
62
|
|
|
63
63
|
[`CancellablePromise`](cancellableIntent.md#cancellablepromise)
|
|
64
64
|
|
|
65
|
-
##### clearActiveOnResolved
|
|
65
|
+
##### clearActiveOnResolved?
|
|
66
66
|
|
|
67
|
-
> **clearActiveOnResolved**: `boolean`
|
|
67
|
+
> `optional` **clearActiveOnResolved**: `boolean`
|
|
68
68
|
|
|
69
69
|
Whether to clear the active state when the promise resolves.
|
|
70
70
|
|
|
71
|
-
##### guardArguments
|
|
71
|
+
##### guardArguments?
|
|
72
72
|
|
|
73
|
-
> **guardArguments**: `any`
|
|
73
|
+
> `optional` **guardArguments**: `any`
|
|
74
74
|
|
|
75
75
|
The reactive object to watch for truthiness before running the intent.
|
|
76
76
|
|
|
77
|
-
##### watchArguments
|
|
77
|
+
##### watchArguments?
|
|
78
78
|
|
|
79
|
-
> **watchArguments**: `any`
|
|
79
|
+
> `optional` **watchArguments**: `any`
|
|
80
80
|
|
|
81
81
|
The reactive object to watch for changes.
|
|
82
82
|
|
|
@@ -120,7 +120,9 @@ If the promise is not resolved before the watch arguments change again, the prev
|
|
|
120
120
|
|
|
121
121
|
#### Parameters
|
|
122
122
|
|
|
123
|
-
|
|
123
|
+
##### options
|
|
124
|
+
|
|
125
|
+
[`CancellableIntentOptions`](cancellableIntent.md#cancellableintentoptions)
|
|
124
126
|
|
|
125
127
|
The options for the cancellable intent.
|
|
126
128
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[**@arrai-innovations/reactive-helpers**](../README.md)
|
|
1
|
+
[**@arrai-innovations/reactive-helpers**](../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
### CSSClasses
|
|
12
12
|
|
|
13
|
-
> **CSSClasses**\<\>: `string` \| `string`[] \|
|
|
13
|
+
> **CSSClasses**\<\>: `string` \| `string`[] \| \{\} \| `Ref`
|
|
14
14
|
|
|
15
15
|
#### Type Parameters
|
|
16
16
|
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
### useCombineClasses()
|
|
20
20
|
|
|
21
|
-
> **useCombineClasses**(...`classes`): `Ref`\<[`CombinedClasses`](../utils/classes.md#combinedclasses)\>
|
|
21
|
+
> **useCombineClasses**(...`classes`): `Ref`\<[`CombinedClasses`](../utils/classes.md#combinedclasses), [`CombinedClasses`](../utils/classes.md#combinedclasses)\>
|
|
22
22
|
|
|
23
23
|
Normalize various ways of specifying CSS classes into an object for use in Vue.js with reactivity. If refs are
|
|
24
24
|
present, the resulting object will be a ref containing an array of objects to preserve order of operations in
|
|
@@ -26,13 +26,15 @@ Normalize various ways of specifying CSS classes into an object for use in Vue.j
|
|
|
26
26
|
|
|
27
27
|
#### Parameters
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
##### classes
|
|
30
|
+
|
|
31
|
+
...[`CSSClasses`](combineClasses.md#cssclasses)[]
|
|
30
32
|
|
|
31
33
|
A mixed array containing multiple ways of specifying CSS classes.
|
|
32
34
|
|
|
33
35
|
#### Returns
|
|
34
36
|
|
|
35
|
-
`Ref`\<[`CombinedClasses`](../utils/classes.md#combinedclasses)\>
|
|
37
|
+
`Ref`\<[`CombinedClasses`](../utils/classes.md#combinedclasses), [`CombinedClasses`](../utils/classes.md#combinedclasses)\>
|
|
36
38
|
|
|
37
39
|
- A ref
|
|
38
40
|
containing an object or array of objects containing CSS classes. Arrays are used if refs are present, to
|