@cascateer/core 2.4.27 → 2.4.29

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": "@cascateer/core",
3
- "version": "2.4.27",
3
+ "version": "2.4.29",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/cascateer/core.git"
package/src/multicast.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import { property } from "@cascateer/lib";
2
2
  import { flatMap, reduce } from "@cascateer/lib/observables";
3
- import assert from "assert";
4
3
  import { partition, thru, uniq, uniqBy } from "lodash";
5
4
  import {
6
5
  distinct,
@@ -88,7 +87,13 @@ self.addEventListener("connect", ({ ports }) => {
88
87
  reduce(
89
88
  ({ id: previousId }, action) =>
90
89
  action.type === "seedAction" ? action : { ...action, previousId },
91
- (action) => (assert(action.type === "seedAction"), action),
90
+ (action) => {
91
+ if (action.type !== "seedAction") {
92
+ throw new Error();
93
+ }
94
+
95
+ return action;
96
+ },
92
97
  ),
93
98
  map(({ origin, ...message }) => message),
94
99
  exchangeWith<MulticastClientMessage, MulticastActionMessage<any>>(port),
package/src/store.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { EndoFunction, ExtendableDictionary } from "@cascateer/lib";
2
2
  import { flatMap, reduce } from "@cascateer/lib/observables";
3
3
  import assert from "assert";
4
- import { constant, Dictionary, mapValues, tap } from "lodash";
4
+ import { constant, Dictionary, mapValues, noop, tap } from "lodash";
5
5
  import {
6
6
  merge,
7
7
  mergeMap,
@@ -232,8 +232,9 @@ export class StoreProvider<Data> extends ExtendableStoreAdapter<
232
232
 
233
233
  assert(action.previousId === previousAction?.id);
234
234
 
235
- return tap(action.predicate(previousState), (state) =>
236
- action.callback?.call(null, state),
235
+ return tap(
236
+ action.predicate(previousState),
237
+ action.callback ?? noop,
237
238
  );
238
239
  },
239
240
  (action) => (