@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
package/use/cancellableIntent.js
CHANGED
|
@@ -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
|
-
|
|
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;
|
package/use/listSubscription.js
CHANGED
|
@@ -156,10 +156,10 @@ export function useListSubscription({ listInstance, props, functions }) {
|
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
158
|
|
|
159
|
-
function
|
|
159
|
+
function clearError() {
|
|
160
160
|
state.subscriptionErrored = false;
|
|
161
161
|
state.subscriptionError = null;
|
|
162
|
-
listInstance.
|
|
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
|
-
|
|
226
|
+
clearError,
|
|
227
227
|
effectScope: es,
|
|
228
228
|
};
|
|
229
229
|
}
|