@arrai-innovations/reactive-helpers 2.1.1 → 2.1.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arrai-innovations/reactive-helpers",
3
- "version": "2.1.1",
3
+ "version": "2.1.2",
4
4
  "description": "VueJS 3 utility composition functions to help manipulate objects and lists.",
5
5
  "main": "index.js",
6
6
  "directories": {
@@ -152,6 +152,11 @@ export function useListInstance({ crudArgs, listArgs = {}, retrieveArgs = {} })
152
152
  return getFakeId(state.objects);
153
153
  }
154
154
 
155
+ function clearError() {
156
+ state.errored = false;
157
+ state.error = null;
158
+ }
159
+
155
160
  const es = effectScope();
156
161
 
157
162
  es.run(() => {
@@ -165,10 +170,11 @@ export function useListInstance({ crudArgs, listArgs = {}, retrieveArgs = {} })
165
170
  updateListObject,
166
171
  deleteListObject,
167
172
  clearList,
168
- effectScope: es,
173
+ clearError,
169
174
  getFakeId: ourGetFakeId,
170
175
  defaultPageCallback,
171
176
  pageCallback: defaultPageCallback,
177
+ effectScope: es,
172
178
  };
173
179
  return returnedObject;
174
180
  }
@@ -138,6 +138,12 @@ export function useListSubscription({ listInstance, crudArgs, listArgs, retrieve
138
138
  }
139
139
  }
140
140
 
141
+ function clearErrors() {
142
+ state.subscriptionErrored = false;
143
+ state.subscriptionError = null;
144
+ listInstance.clearErrors();
145
+ }
146
+
141
147
  const es = effectScope();
142
148
 
143
149
  es.run(() => {
@@ -191,6 +197,7 @@ export function useListSubscription({ listInstance, crudArgs, listArgs, retrieve
191
197
  subscribeIntent,
192
198
  subscribe: publicSubscribe,
193
199
  unsubscribe: publicUnsubscribe,
200
+ clearErrors,
194
201
  effectScope: es,
195
202
  };
196
203
  }
@@ -209,6 +209,11 @@ export function useObjectInstance({ crudArgs, id, retrieveArgs }) {
209
209
  });
210
210
  }
211
211
 
212
+ function clearError() {
213
+ state.errored = false;
214
+ state.error = null;
215
+ }
216
+
212
217
  const es = effectScope();
213
218
 
214
219
  // we could have effects? let's keep the interface to keep our options open to add without major changes.
@@ -221,6 +226,7 @@ export function useObjectInstance({ crudArgs, id, retrieveArgs }) {
221
226
  update,
222
227
  patch,
223
228
  delete: deleteFn,
229
+ clearError,
224
230
  effectScope: es,
225
231
  };
226
232
  }
@@ -147,6 +147,12 @@ export function useObjectSubscription({ objectInstance, crudArgs, id, retrieveAr
147
147
  return didUnsubscribe;
148
148
  }
149
149
 
150
+ function clearError() {
151
+ state.subscriptionErrored = false;
152
+ state.subscriptionError = null;
153
+ objectInstance.clearError();
154
+ }
155
+
150
156
  const es = effectScope();
151
157
 
152
158
  es.run(() => {
@@ -179,6 +185,7 @@ export function useObjectSubscription({ objectInstance, crudArgs, id, retrieveAr
179
185
  unsubscribe: publicUnsubscribe,
180
186
  updateFromSubscription,
181
187
  deleteFromSubscription,
188
+ clearError,
182
189
  effectScope: es,
183
190
  };
184
191
  }