@arrai-innovations/reactive-helpers 14.1.0 → 16.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/config/listCrud.js +19 -4
- package/config/objectCrud.js +2 -2
- package/docs/README.md +1 -0
- package/docs/config/listCrud.md +70 -6
- package/docs/config/objectCrud.md +13 -3
- package/docs/use/list.md +54 -0
- package/docs/use/listInstance.md +31 -4
- package/docs/use/listSubscription.md +3 -1
- package/docs/use/loadingError.md +16 -6
- package/docs/use/object.md +4 -4
- package/docs/use/objectCalculated.md +4 -4
- package/docs/use/objectInstance.md +59 -17
- package/docs/use/objectRelated.md +4 -4
- package/docs/use/objectSubscription.md +2 -2
- package/docs/utils/classes.md +1 -1
- package/docs/utils/keepAliveTry.md +51 -0
- package/index.js +1 -0
- package/package.json +2 -1
- package/tests/unit/config/listCrud.spec.js +3 -1
- package/tests/unit/use/listCalculated.spec.js +4 -4
- package/tests/unit/use/listFilter.spec.js +11 -9
- package/tests/unit/use/listInstance.spec.js +385 -22
- package/tests/unit/use/listRelated.spec.js +5 -5
- package/tests/unit/use/listSearch.spec.js +14 -11
- package/tests/unit/use/listSort.spec.js +8 -0
- package/tests/unit/use/listSubscription.spec.js +64 -0
- package/tsconfig.json +2 -2
- package/typedoc.json +0 -1
- package/use/cancellableIntent.js +21 -2
- package/use/list.js +28 -3
- package/use/listInstance.js +39 -4
- package/use/listKeys.js +1 -0
- package/use/listSubscription.js +18 -8
- package/use/loadingError.js +5 -1
- package/use/objectCalculated.js +42 -38
- package/use/objectInstance.js +9 -9
- package/use/paginatedListInstance.js +6 -3
- package/utils/keepAliveTry.js +28 -0
package/config/listCrud.js
CHANGED
|
@@ -14,6 +14,7 @@ const defaultCrud = {
|
|
|
14
14
|
list: undefined,
|
|
15
15
|
bulkDelete: undefined,
|
|
16
16
|
subscribe: undefined,
|
|
17
|
+
executeAction: undefined,
|
|
17
18
|
};
|
|
18
19
|
|
|
19
20
|
/**
|
|
@@ -65,21 +66,34 @@ const defaultCrud = {
|
|
|
65
66
|
*/
|
|
66
67
|
|
|
67
68
|
/**
|
|
68
|
-
* @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.
|
|
78
|
+
*/
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* @typedef {(DeleteFnArgs)=>Promise<boolean> & { cancel: () => Promise<void>|void }} BulkDeleteFn - The delete function to bulk delete a list of items.
|
|
69
82
|
*/
|
|
70
83
|
|
|
71
84
|
/**
|
|
72
|
-
* @typedef {(
|
|
85
|
+
* @typedef {(SubscribeFnArgs)=>Promise<boolean> & { cancel: () => Promise<void>|void }} SubscribeFn - The subscribe function to set up a subscription to a list of items.
|
|
73
86
|
*/
|
|
74
87
|
|
|
75
88
|
/**
|
|
76
|
-
* @typedef {(
|
|
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.
|
|
77
90
|
*/
|
|
78
91
|
|
|
79
92
|
/**
|
|
80
93
|
* @typedef {object} ListCrudFunctions
|
|
81
94
|
* @property {ListFn} [list] - The list function to get a list of items.
|
|
82
95
|
* @property {BulkDeleteFn} [bulkDelete] - The delete function to bulk delete a list of items.
|
|
96
|
+
* @property {ExecuteActionFn} [executeAction] - The function to execute a certain action on a list of items.
|
|
83
97
|
* @property {SubscribeFn} [subscribe] - The subscribe function to get a subscription to a list of items.
|
|
84
98
|
*/
|
|
85
99
|
|
|
@@ -95,10 +109,11 @@ const defaultCrud = {
|
|
|
95
109
|
* @throws {Error} - If unknown keys are passed.
|
|
96
110
|
* @returns {void}
|
|
97
111
|
*/
|
|
98
|
-
export const setListCrud = ({ list, bulkDelete, subscribe, args = {}, ...rest }) => {
|
|
112
|
+
export const setListCrud = ({ list, bulkDelete, subscribe, executeAction, args = {}, ...rest }) => {
|
|
99
113
|
defaultCrud.list = list;
|
|
100
114
|
defaultCrud.subscribe = subscribe;
|
|
101
115
|
defaultCrud.bulkDelete = bulkDelete;
|
|
116
|
+
defaultCrud.executeAction = executeAction;
|
|
102
117
|
Object.assign(defaultCrud.args, cloneDeep(args));
|
|
103
118
|
if (Object.keys(rest).length) {
|
|
104
119
|
throw new Error(`Unknown key(s) passed to setListCrud: ${Object.keys(rest).join(", ")}`);
|
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
|
@@ -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
|
@@ -32,6 +32,36 @@ 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
|
|
@@ -54,6 +84,12 @@ The default arguments for the crud functions.
|
|
|
54
84
|
|
|
55
85
|
The delete function to bulk delete a list of items.
|
|
56
86
|
|
|
87
|
+
##### executeAction
|
|
88
|
+
|
|
89
|
+
> **executeAction**: [`ExecuteActionFn`](listCrud.md#executeactionfn)
|
|
90
|
+
|
|
91
|
+
The function to execute a certain action on a list of items.
|
|
92
|
+
|
|
57
93
|
##### list
|
|
58
94
|
|
|
59
95
|
> **list**: [`ListFn`](listCrud.md#listfn)
|
|
@@ -173,7 +209,9 @@ The method to call when new data is received.
|
|
|
173
209
|
|
|
174
210
|
### BulkDeleteFn()
|
|
175
211
|
|
|
176
|
-
> **BulkDeleteFn**\<\>: (`DeleteFnArgs`) => `
|
|
212
|
+
> **BulkDeleteFn**\<\>: (`DeleteFnArgs`) => `Promise`\<`boolean`\> & `object`
|
|
213
|
+
|
|
214
|
+
The delete function to bulk delete a list of items.
|
|
177
215
|
|
|
178
216
|
#### Type Parameters
|
|
179
217
|
|
|
@@ -183,13 +221,33 @@ The method to call when new data is received.
|
|
|
183
221
|
|
|
184
222
|
#### Returns
|
|
185
223
|
|
|
186
|
-
`
|
|
224
|
+
`Promise`\<`boolean`\> & `object`
|
|
225
|
+
|
|
226
|
+
***
|
|
227
|
+
|
|
228
|
+
### ExecuteActionFn()
|
|
229
|
+
|
|
230
|
+
> **ExecuteActionFn**\<\>: (`ExecuteActionFnArgs`) => `Promise`\<[`config/objectCrud`](objectCrud.md) \| `false`\> & `object`
|
|
231
|
+
|
|
232
|
+
The function to execute a certain action on a list of items, returning the response data or false.
|
|
233
|
+
|
|
234
|
+
#### Type Parameters
|
|
235
|
+
|
|
236
|
+
#### Parameters
|
|
237
|
+
|
|
238
|
+
• **ExecuteActionFnArgs**: `any`
|
|
239
|
+
|
|
240
|
+
#### Returns
|
|
241
|
+
|
|
242
|
+
`Promise`\<[`config/objectCrud`](objectCrud.md) \| `false`\> & `object`
|
|
187
243
|
|
|
188
244
|
***
|
|
189
245
|
|
|
190
246
|
### ListFn()
|
|
191
247
|
|
|
192
|
-
> **ListFn**\<\>: (`ListFnArgs`) => `
|
|
248
|
+
> **ListFn**\<\>: (`ListFnArgs`) => `Promise`\<`boolean`\> & `object`
|
|
249
|
+
|
|
250
|
+
The list function to get a list of items, returning a boolean indicating success.
|
|
193
251
|
|
|
194
252
|
#### Type Parameters
|
|
195
253
|
|
|
@@ -199,7 +257,7 @@ The method to call when new data is received.
|
|
|
199
257
|
|
|
200
258
|
#### Returns
|
|
201
259
|
|
|
202
|
-
`
|
|
260
|
+
`Promise`\<`boolean`\> & `object`
|
|
203
261
|
|
|
204
262
|
***
|
|
205
263
|
|
|
@@ -223,7 +281,9 @@ The method to call when new data is received.
|
|
|
223
281
|
|
|
224
282
|
### SubscribeFn()
|
|
225
283
|
|
|
226
|
-
> **SubscribeFn**\<\>: (`SubscribeFnArgs`) => `
|
|
284
|
+
> **SubscribeFn**\<\>: (`SubscribeFnArgs`) => `Promise`\<`boolean`\> & `object`
|
|
285
|
+
|
|
286
|
+
The subscribe function to set up a subscription to a list of items.
|
|
227
287
|
|
|
228
288
|
#### Type Parameters
|
|
229
289
|
|
|
@@ -233,7 +293,7 @@ The method to call when new data is received.
|
|
|
233
293
|
|
|
234
294
|
#### Returns
|
|
235
295
|
|
|
236
|
-
`
|
|
296
|
+
`Promise`\<`boolean`\> & `object`
|
|
237
297
|
|
|
238
298
|
***
|
|
239
299
|
|
|
@@ -275,6 +335,10 @@ The default arguments for the crud functions.
|
|
|
275
335
|
|
|
276
336
|
The delete function to bulk delete a list of items.
|
|
277
337
|
|
|
338
|
+
• **reactiveCrud.executeAction**: [`ExecuteActionFn`](listCrud.md#executeactionfn)
|
|
339
|
+
|
|
340
|
+
The function to execute a certain action on a list of items.
|
|
341
|
+
|
|
278
342
|
• **reactiveCrud.list**: [`ListFn`](listCrud.md#listfn)
|
|
279
343
|
|
|
280
344
|
The list function to get a list of items.
|
|
@@ -142,7 +142,7 @@ A function to be used instead of the default crud retrieve function.
|
|
|
142
142
|
|
|
143
143
|
##### subscribe()
|
|
144
144
|
|
|
145
|
-
> **subscribe**: (`SubscribeArgs`) => `void`
|
|
145
|
+
> **subscribe**: (`SubscribeArgs`) => `void` & `object`
|
|
146
146
|
|
|
147
147
|
A function to be used instead of the default crud subscribe function.
|
|
148
148
|
|
|
@@ -152,7 +152,7 @@ A function to be used instead of the default crud subscribe function.
|
|
|
152
152
|
|
|
153
153
|
###### Returns
|
|
154
154
|
|
|
155
|
-
`void`
|
|
155
|
+
`void` & `object`
|
|
156
156
|
|
|
157
157
|
##### update()
|
|
158
158
|
|
|
@@ -322,7 +322,17 @@ The arguments to be passed to the retrieve function.
|
|
|
322
322
|
|
|
323
323
|
### ResponseData
|
|
324
324
|
|
|
325
|
-
> **ResponseData**\<\>: `Promise`\<`object` \| `string`\>
|
|
325
|
+
> **ResponseData**\<\>: `Promise`\<`object` \| `string`\> & `object`
|
|
326
|
+
|
|
327
|
+
#### Type declaration
|
|
328
|
+
|
|
329
|
+
##### cancel()
|
|
330
|
+
|
|
331
|
+
> **cancel**: () => `Promise`\<`void`\> \| `void`
|
|
332
|
+
|
|
333
|
+
###### Returns
|
|
334
|
+
|
|
335
|
+
`Promise`\<`void`\> \| `void`
|
|
326
336
|
|
|
327
337
|
#### Type Parameters
|
|
328
338
|
|
package/docs/use/list.md
CHANGED
|
@@ -6,6 +6,56 @@
|
|
|
6
6
|
|
|
7
7
|
# use/list
|
|
8
8
|
|
|
9
|
+
## Classes
|
|
10
|
+
|
|
11
|
+
### ListError
|
|
12
|
+
|
|
13
|
+
Custom error class for use list errors.
|
|
14
|
+
|
|
15
|
+
#### Extends
|
|
16
|
+
|
|
17
|
+
- `Error`
|
|
18
|
+
|
|
19
|
+
#### Constructors
|
|
20
|
+
|
|
21
|
+
##### new ListError()
|
|
22
|
+
|
|
23
|
+
> **new ListError**(`message`, `code`): [`ListError`](list.md#listerror)
|
|
24
|
+
|
|
25
|
+
Creates a new ListError.
|
|
26
|
+
|
|
27
|
+
###### Parameters
|
|
28
|
+
|
|
29
|
+
• **message**: `string`
|
|
30
|
+
|
|
31
|
+
The error message.
|
|
32
|
+
|
|
33
|
+
• **code**: `string`
|
|
34
|
+
|
|
35
|
+
The error code.
|
|
36
|
+
|
|
37
|
+
###### Returns
|
|
38
|
+
|
|
39
|
+
[`ListError`](list.md#listerror)
|
|
40
|
+
|
|
41
|
+
###### Overrides
|
|
42
|
+
|
|
43
|
+
`Error.constructor`
|
|
44
|
+
|
|
45
|
+
#### Properties
|
|
46
|
+
|
|
47
|
+
##### code
|
|
48
|
+
|
|
49
|
+
> **code**: `string`
|
|
50
|
+
|
|
51
|
+
##### name
|
|
52
|
+
|
|
53
|
+
> **name**: `string`
|
|
54
|
+
|
|
55
|
+
###### Inherited from
|
|
56
|
+
|
|
57
|
+
`Error.name`
|
|
58
|
+
|
|
9
59
|
## Interfaces
|
|
10
60
|
|
|
11
61
|
### ListManagerProperties
|
|
@@ -280,6 +330,10 @@ The options for the list./.
|
|
|
280
330
|
```vue
|
|
281
331
|
```
|
|
282
332
|
|
|
333
|
+
#### Throws
|
|
334
|
+
|
|
335
|
+
- If required options are not provided.
|
|
336
|
+
|
|
283
337
|
***
|
|
284
338
|
|
|
285
339
|
### useLists()
|
package/docs/use/listInstance.md
CHANGED
|
@@ -77,6 +77,16 @@ Adds an object to the list.
|
|
|
77
77
|
|
|
78
78
|
`void`
|
|
79
79
|
|
|
80
|
+
##### bulkDelete()
|
|
81
|
+
|
|
82
|
+
> **bulkDelete**: () => `Promise`\<`boolean`\>
|
|
83
|
+
|
|
84
|
+
Initiates a bulk delete operation on all objects in the list, returning a promise to a boolean indicating success.
|
|
85
|
+
|
|
86
|
+
###### Returns
|
|
87
|
+
|
|
88
|
+
`Promise`\<`boolean`\>
|
|
89
|
+
|
|
80
90
|
##### clearList()
|
|
81
91
|
|
|
82
92
|
> **clearList**: () => `void`
|
|
@@ -115,6 +125,16 @@ Deletes an object from the list by pk.
|
|
|
115
125
|
|
|
116
126
|
`void`
|
|
117
127
|
|
|
128
|
+
##### executeAction()
|
|
129
|
+
|
|
130
|
+
> **executeAction**: () => `Promise`\<`any`\>
|
|
131
|
+
|
|
132
|
+
Initiates an action on all objects in the list, returning the response, or false if the action failed.
|
|
133
|
+
|
|
134
|
+
###### Returns
|
|
135
|
+
|
|
136
|
+
`Promise`\<`any`\>
|
|
137
|
+
|
|
118
138
|
##### getFakePk()
|
|
119
139
|
|
|
120
140
|
> **getFakePk**: () => `string`
|
|
@@ -127,13 +147,13 @@ Generates a unique fake pk for use within the list.
|
|
|
127
147
|
|
|
128
148
|
##### list()
|
|
129
149
|
|
|
130
|
-
> **list**: () => `Promise`\<`
|
|
150
|
+
> **list**: () => `Promise`\<`boolean`\>
|
|
131
151
|
|
|
132
|
-
Initiates a fetch to retrieve objects according to the CRUD configuration.
|
|
152
|
+
Initiates a fetch to retrieve objects according to the CRUD configuration, returning a promise to a boolean indicating success.
|
|
133
153
|
|
|
134
154
|
###### Returns
|
|
135
155
|
|
|
136
|
-
`Promise`\<`
|
|
156
|
+
`Promise`\<`boolean`\>
|
|
137
157
|
|
|
138
158
|
##### pageCallback()
|
|
139
159
|
|
|
@@ -182,6 +202,13 @@ Default implementation are used as set by `setListCrud`.
|
|
|
182
202
|
Provide the implementation for the bulkDelete
|
|
183
203
|
function.
|
|
184
204
|
|
|
205
|
+
###### executeAction
|
|
206
|
+
|
|
207
|
+
> **executeAction**: [`ExecuteActionFn`](../config/listCrud.md#executeactionfn)
|
|
208
|
+
|
|
209
|
+
Provide the implementation for the executeAction
|
|
210
|
+
function.
|
|
211
|
+
|
|
185
212
|
###### list
|
|
186
213
|
|
|
187
214
|
> **list**: [`ListFn`](../config/listCrud.md#listfn)
|
|
@@ -493,7 +520,7 @@ watch(toRef(props, "someListFilter"), (newValue, oldValue) => {
|
|
|
493
520
|
|
|
494
521
|
#### Throws
|
|
495
522
|
|
|
496
|
-
If the props are missing.
|
|
523
|
+
If the props or keepOldPages are missing.
|
|
497
524
|
|
|
498
525
|
***
|
|
499
526
|
|
|
@@ -362,7 +362,9 @@ const listSubscription = useListSubscription({ props: listSubscriptionProps });
|
|
|
362
362
|
|
|
363
363
|
#### Throws
|
|
364
364
|
|
|
365
|
-
- If both listInstance and props are passed, or if neither are
|
|
365
|
+
- If both listInstance and props are passed, or if neither are
|
|
366
|
+
passed. Also thrown if clearListOnListIntentTriggered is not passed or if neither listInstance
|
|
367
|
+
nor keepOldPages are passed.
|
|
366
368
|
|
|
367
369
|
***
|
|
368
370
|
|
package/docs/use/loadingError.md
CHANGED
|
@@ -52,16 +52,12 @@ Set the loading state.
|
|
|
52
52
|
|
|
53
53
|
#### Properties
|
|
54
54
|
|
|
55
|
-
##### clearError
|
|
55
|
+
##### clearError
|
|
56
56
|
|
|
57
|
-
> **clearError**: ()
|
|
57
|
+
> **clearError**: [`ClearErrorFn`](loadingError.md#clearerrorfn)
|
|
58
58
|
|
|
59
59
|
Clear the error state.
|
|
60
60
|
|
|
61
|
-
###### Returns
|
|
62
|
-
|
|
63
|
-
`void`
|
|
64
|
-
|
|
65
61
|
##### error
|
|
66
62
|
|
|
67
63
|
> **error**: `Readonly`\<`Ref`\<`Error`\>\>
|
|
@@ -82,6 +78,20 @@ Whether the component is loading.
|
|
|
82
78
|
|
|
83
79
|
## Type Aliases
|
|
84
80
|
|
|
81
|
+
### ClearErrorFn()
|
|
82
|
+
|
|
83
|
+
> **ClearErrorFn**\<\>: () => `void`
|
|
84
|
+
|
|
85
|
+
Clear the error state.
|
|
86
|
+
|
|
87
|
+
#### Type Parameters
|
|
88
|
+
|
|
89
|
+
#### Returns
|
|
90
|
+
|
|
91
|
+
`void`
|
|
92
|
+
|
|
93
|
+
***
|
|
94
|
+
|
|
85
95
|
### LoadingError
|
|
86
96
|
|
|
87
97
|
> **LoadingError**\<\>: [`LoadingErrorStatus`](loadingError.md#loadingerrorstatus) & [`LoadingErrorMutations`](loadingError.md#loadingerrormutations)
|
package/docs/use/object.md
CHANGED
|
@@ -100,7 +100,7 @@ A function to be used instead of the default crud retrieve function.
|
|
|
100
100
|
|
|
101
101
|
###### crudArgs.subscribe()
|
|
102
102
|
|
|
103
|
-
> **subscribe**: (`SubscribeArgs`) => `void`
|
|
103
|
+
> **subscribe**: (`SubscribeArgs`) => `void` & `object`
|
|
104
104
|
|
|
105
105
|
A function to be used instead of the default crud subscribe function.
|
|
106
106
|
|
|
@@ -110,7 +110,7 @@ A function to be used instead of the default crud subscribe function.
|
|
|
110
110
|
|
|
111
111
|
###### Returns
|
|
112
112
|
|
|
113
|
-
`void`
|
|
113
|
+
`void` & `object`
|
|
114
114
|
|
|
115
115
|
###### crudArgs.update()
|
|
116
116
|
|
|
@@ -284,7 +284,7 @@ A function to be used instead of the default crud retrieve function.
|
|
|
284
284
|
|
|
285
285
|
###### crud.subscribe()
|
|
286
286
|
|
|
287
|
-
> **subscribe**: (`SubscribeArgs`) => `void`
|
|
287
|
+
> **subscribe**: (`SubscribeArgs`) => `void` & `object`
|
|
288
288
|
|
|
289
289
|
A function to be used instead of the default crud subscribe function.
|
|
290
290
|
|
|
@@ -294,7 +294,7 @@ A function to be used instead of the default crud subscribe function.
|
|
|
294
294
|
|
|
295
295
|
###### Returns
|
|
296
296
|
|
|
297
|
-
`void`
|
|
297
|
+
`void` & `object`
|
|
298
298
|
|
|
299
299
|
###### crud.update()
|
|
300
300
|
|
|
@@ -94,7 +94,7 @@ A function to be used instead of the default crud retrieve function.
|
|
|
94
94
|
|
|
95
95
|
###### crud.subscribe()
|
|
96
96
|
|
|
97
|
-
> **subscribe**: (`SubscribeArgs`) => `void`
|
|
97
|
+
> **subscribe**: (`SubscribeArgs`) => `void` & `object`
|
|
98
98
|
|
|
99
99
|
A function to be used instead of the default crud subscribe function.
|
|
100
100
|
|
|
@@ -104,7 +104,7 @@ A function to be used instead of the default crud subscribe function.
|
|
|
104
104
|
|
|
105
105
|
###### Returns
|
|
106
106
|
|
|
107
|
-
`void`
|
|
107
|
+
`void` & `object`
|
|
108
108
|
|
|
109
109
|
###### crud.update()
|
|
110
110
|
|
|
@@ -348,7 +348,7 @@ A function to be used instead of the default crud retrieve function.
|
|
|
348
348
|
|
|
349
349
|
###### crud.subscribe()
|
|
350
350
|
|
|
351
|
-
> **subscribe**: (`SubscribeArgs`) => `void`
|
|
351
|
+
> **subscribe**: (`SubscribeArgs`) => `void` & `object`
|
|
352
352
|
|
|
353
353
|
A function to be used instead of the default crud subscribe function.
|
|
354
354
|
|
|
@@ -358,7 +358,7 @@ A function to be used instead of the default crud subscribe function.
|
|
|
358
358
|
|
|
359
359
|
###### Returns
|
|
360
360
|
|
|
361
|
-
`void`
|
|
361
|
+
`void` & `object`
|
|
362
362
|
|
|
363
363
|
###### crud.update()
|
|
364
364
|
|
|
@@ -63,48 +63,90 @@ The error code.
|
|
|
63
63
|
|
|
64
64
|
#### Properties
|
|
65
65
|
|
|
66
|
-
##### clear
|
|
66
|
+
##### clear()
|
|
67
67
|
|
|
68
|
-
> **clear**: `
|
|
68
|
+
> **clear**: () => `void`
|
|
69
69
|
|
|
70
70
|
Called to clear the object state.
|
|
71
71
|
|
|
72
|
+
###### Returns
|
|
73
|
+
|
|
74
|
+
`void`
|
|
75
|
+
|
|
72
76
|
##### clearError
|
|
73
77
|
|
|
74
|
-
> **clearError**: `
|
|
78
|
+
> **clearError**: [`ClearErrorFn`](loadingError.md#clearerrorfn)
|
|
75
79
|
|
|
76
80
|
Called to clear the error state.
|
|
77
81
|
|
|
78
|
-
##### create
|
|
82
|
+
##### create()
|
|
79
83
|
|
|
80
|
-
> **create**: `
|
|
84
|
+
> **create**: (`args`) => `Promise`\<`boolean`\>
|
|
81
85
|
|
|
82
86
|
Called to turn the current object into a new object on the server.
|
|
83
87
|
|
|
84
|
-
|
|
88
|
+
###### Parameters
|
|
89
|
+
|
|
90
|
+
• **args**
|
|
91
|
+
|
|
92
|
+
• **args.object**: `any`
|
|
93
|
+
|
|
94
|
+
###### Returns
|
|
85
95
|
|
|
86
|
-
|
|
96
|
+
`Promise`\<`boolean`\>
|
|
97
|
+
|
|
98
|
+
##### delete()
|
|
99
|
+
|
|
100
|
+
> **delete**: () => `Promise`\<`boolean`\>
|
|
87
101
|
|
|
88
102
|
Called to delete the current object on the server.
|
|
89
103
|
|
|
90
|
-
|
|
104
|
+
###### Returns
|
|
105
|
+
|
|
106
|
+
`Promise`\<`boolean`\>
|
|
91
107
|
|
|
92
|
-
|
|
108
|
+
##### patch()
|
|
109
|
+
|
|
110
|
+
> **patch**: (`args`) => `Promise`\<`boolean`\>
|
|
93
111
|
|
|
94
112
|
Called to patch the current object on the server.
|
|
95
113
|
|
|
96
|
-
|
|
114
|
+
###### Parameters
|
|
115
|
+
|
|
116
|
+
• **args**
|
|
97
117
|
|
|
98
|
-
|
|
118
|
+
• **args.partialObject**: [`CrudObject`](objectInstance.md#crudobject)
|
|
119
|
+
|
|
120
|
+
###### Returns
|
|
121
|
+
|
|
122
|
+
`Promise`\<`boolean`\>
|
|
123
|
+
|
|
124
|
+
##### retrieve()
|
|
125
|
+
|
|
126
|
+
> **retrieve**: () => `Promise`\<`boolean`\>
|
|
99
127
|
|
|
100
128
|
Called to retrieve the current object by pk from the server.
|
|
101
129
|
|
|
102
|
-
|
|
130
|
+
###### Returns
|
|
131
|
+
|
|
132
|
+
`Promise`\<`boolean`\>
|
|
103
133
|
|
|
104
|
-
|
|
134
|
+
##### update()
|
|
135
|
+
|
|
136
|
+
> **update**: (`args`) => `Promise`\<`boolean`\>
|
|
105
137
|
|
|
106
138
|
Called to update the current object on the server.
|
|
107
139
|
|
|
140
|
+
###### Parameters
|
|
141
|
+
|
|
142
|
+
• **args**
|
|
143
|
+
|
|
144
|
+
• **args.object**: [`CrudObject`](objectInstance.md#crudobject)
|
|
145
|
+
|
|
146
|
+
###### Returns
|
|
147
|
+
|
|
148
|
+
`Promise`\<`boolean`\>
|
|
149
|
+
|
|
108
150
|
***
|
|
109
151
|
|
|
110
152
|
### ObjectInstanceOptions
|
|
@@ -193,7 +235,7 @@ A function to be used instead of the default crud retrieve function.
|
|
|
193
235
|
|
|
194
236
|
###### crudArgs.subscribe()
|
|
195
237
|
|
|
196
|
-
> **subscribe**: (`SubscribeArgs`) => `void`
|
|
238
|
+
> **subscribe**: (`SubscribeArgs`) => `void` & `object`
|
|
197
239
|
|
|
198
240
|
A function to be used instead of the default crud subscribe function.
|
|
199
241
|
|
|
@@ -203,7 +245,7 @@ A function to be used instead of the default crud subscribe function.
|
|
|
203
245
|
|
|
204
246
|
###### Returns
|
|
205
247
|
|
|
206
|
-
`void`
|
|
248
|
+
`void` & `object`
|
|
207
249
|
|
|
208
250
|
###### crudArgs.update()
|
|
209
251
|
|
|
@@ -319,7 +361,7 @@ A function to be used instead of the default crud retrieve function.
|
|
|
319
361
|
|
|
320
362
|
###### crud.subscribe()
|
|
321
363
|
|
|
322
|
-
> **subscribe**: (`SubscribeArgs`) => `void`
|
|
364
|
+
> **subscribe**: (`SubscribeArgs`) => `void` & `object`
|
|
323
365
|
|
|
324
366
|
A function to be used instead of the default crud subscribe function.
|
|
325
367
|
|
|
@@ -329,7 +371,7 @@ A function to be used instead of the default crud subscribe function.
|
|
|
329
371
|
|
|
330
372
|
###### Returns
|
|
331
373
|
|
|
332
|
-
`void`
|
|
374
|
+
`void` & `object`
|
|
333
375
|
|
|
334
376
|
###### crud.update()
|
|
335
377
|
|
|
@@ -94,7 +94,7 @@ A function to be used instead of the default crud retrieve function.
|
|
|
94
94
|
|
|
95
95
|
###### crud.subscribe()
|
|
96
96
|
|
|
97
|
-
> **subscribe**: (`SubscribeArgs`) => `void`
|
|
97
|
+
> **subscribe**: (`SubscribeArgs`) => `void` & `object`
|
|
98
98
|
|
|
99
99
|
A function to be used instead of the default crud subscribe function.
|
|
100
100
|
|
|
@@ -104,7 +104,7 @@ A function to be used instead of the default crud subscribe function.
|
|
|
104
104
|
|
|
105
105
|
###### Returns
|
|
106
106
|
|
|
107
|
-
`void`
|
|
107
|
+
`void` & `object`
|
|
108
108
|
|
|
109
109
|
###### crud.update()
|
|
110
110
|
|
|
@@ -280,7 +280,7 @@ A function to be used instead of the default crud retrieve function.
|
|
|
280
280
|
|
|
281
281
|
###### crud.subscribe()
|
|
282
282
|
|
|
283
|
-
> **subscribe**: (`SubscribeArgs`) => `void`
|
|
283
|
+
> **subscribe**: (`SubscribeArgs`) => `void` & `object`
|
|
284
284
|
|
|
285
285
|
A function to be used instead of the default crud subscribe function.
|
|
286
286
|
|
|
@@ -290,7 +290,7 @@ A function to be used instead of the default crud subscribe function.
|
|
|
290
290
|
|
|
291
291
|
###### Returns
|
|
292
292
|
|
|
293
|
-
`void`
|
|
293
|
+
`void` & `object`
|
|
294
294
|
|
|
295
295
|
###### crud.update()
|
|
296
296
|
|