@cascateer/core 2.4.31 → 2.4.33
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 +1 -1
- package/src/store.ts +14 -11
package/package.json
CHANGED
package/src/store.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { EndoFunction, ExtendableDictionary } from "@cascateer/lib";
|
|
2
2
|
import { flatMap, reduce } from "@cascateer/lib/observables";
|
|
3
|
-
import assert from "assert";
|
|
4
3
|
import { constant, Dictionary, mapValues, noop, tap } from "lodash";
|
|
5
4
|
import {
|
|
6
5
|
merge,
|
|
@@ -230,18 +229,22 @@ export class StoreProvider<Data> extends ExtendableStoreAdapter<
|
|
|
230
229
|
return action.predicate();
|
|
231
230
|
}
|
|
232
231
|
|
|
233
|
-
|
|
232
|
+
if (action.previousId === previousAction?.id) {
|
|
233
|
+
return tap(
|
|
234
|
+
action.predicate(previousState),
|
|
235
|
+
action.callback ?? noop,
|
|
236
|
+
);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
throw new Error();
|
|
240
|
+
},
|
|
241
|
+
(action) => {
|
|
242
|
+
if (action.type === "seedAction") {
|
|
243
|
+
return action.predicate();
|
|
244
|
+
}
|
|
234
245
|
|
|
235
|
-
|
|
236
|
-
action.predicate(previousState),
|
|
237
|
-
action.callback ?? noop,
|
|
238
|
-
);
|
|
246
|
+
throw new Error();
|
|
239
247
|
},
|
|
240
|
-
(action) => (
|
|
241
|
-
console.log(action),
|
|
242
|
-
assert(action.type === "seedAction"),
|
|
243
|
-
action.predicate()
|
|
244
|
-
),
|
|
245
248
|
),
|
|
246
249
|
shareReplay(1),
|
|
247
250
|
),
|