@arrai-innovations/reactive-helpers 8.5.6 → 9.0.1

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": "8.5.6",
3
+ "version": "9.0.1",
4
4
  "description": "VueJS 3 utility composition functions to help manipulate objects and lists.",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -87,13 +87,14 @@ export function useCancellableIntent({
87
87
 
88
88
  const intentWatch = async () => {
89
89
  let newWatchValues = deepUnref(Object.values(watchArguments));
90
- const guardValues = deepUnref(Object.values(guardArguments));
91
90
  if (isEqual(newWatchValues, previousWatchValues)) {
92
91
  return;
93
92
  }
94
93
  previousWatchValues = newWatchValues;
95
- await cancel();
96
- if (Object.values(previousWatchValues).every(identity)) {
94
+ await cancel(); // this can take time so guards and watches can change!
95
+ newWatchValues = deepUnref(Object.values(watchArguments));
96
+ const guardValues = deepUnref(Object.values(guardArguments));
97
+ if (Object.values(newWatchValues).every(identity)) {
97
98
  // if any guards are true, delay the watch.
98
99
  if (guardValues && !isEmpty(guardValues) && guardValues.some(identity)) {
99
100
  delayedWatch = doIntentWatch;
@@ -156,10 +156,10 @@ export function useListSubscription({ listInstance, props, functions }) {
156
156
  }
157
157
  }
158
158
 
159
- function clearErrors() {
159
+ function clearError() {
160
160
  state.subscriptionErrored = false;
161
161
  state.subscriptionError = null;
162
- listInstance.clearErrors();
162
+ listInstance.clearError();
163
163
  }
164
164
 
165
165
  const es = effectScope();
@@ -223,7 +223,7 @@ export function useListSubscription({ listInstance, props, functions }) {
223
223
  subscribeIntent,
224
224
  subscribe: publicSubscribe,
225
225
  unsubscribe: publicUnsubscribe,
226
- clearErrors,
226
+ clearError,
227
227
  effectScope: es,
228
228
  };
229
229
  }