@cascateer/core 2.3.11 → 2.3.13

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.3.11",
3
+ "version": "2.3.13",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/cascateer/core.git"
@@ -18,14 +18,14 @@ interface MulticastActions<Data> {
18
18
  seedAction: {
19
19
  predicate: () => Data;
20
20
  data: {
21
- seed: Data;
21
+ seed: string;
22
22
  };
23
23
  };
24
24
  transformAction: {
25
25
  predicate: Transform<Data>;
26
26
  data: {
27
27
  key: string;
28
- args: unknown;
28
+ args: string;
29
29
  };
30
30
  };
31
31
  }
@@ -52,14 +52,14 @@ export type MulticastAction<
52
52
  };
53
53
  }[Type];
54
54
 
55
- export interface MulticastConnectMessageData<Seed> {
55
+ export interface MulticastConnectMessageData {
56
56
  key: string;
57
- seed: Seed;
57
+ seed: string;
58
58
  }
59
59
 
60
- export type MulticastConnectMessage<Seed = any> = MulticastBaseMessage<
60
+ export type MulticastConnectMessage = MulticastBaseMessage<
61
61
  "connect",
62
- MulticastConnectMessageData<Seed>
62
+ MulticastConnectMessageData
63
63
  >;
64
64
 
65
65
  export type MulticastHostMessage = MulticastActionMessage<any>;
@@ -87,7 +87,10 @@ export const multicast = <Seed>(
87
87
  ({ key, id }): MulticastConnectMessage => ({
88
88
  id,
89
89
  type: "connect",
90
- data: { key, seed },
90
+ data: {
91
+ key,
92
+ seed: JSON.stringify(seed),
93
+ },
91
94
  }),
92
95
  ),
93
96
  concatMap((message) => key.then((key) => message({ key, id: v4() }))),
package/src/store.ts CHANGED
@@ -174,7 +174,7 @@ export class StoreProvider<Data> extends ExtendableStoreAdapter<
174
174
  event.type === "seedAction"
175
175
  ? {
176
176
  ...event,
177
- predicate: constant(event.data.seed),
177
+ predicate: constant(JSON.parse(event.data.seed)),
178
178
  }
179
179
  : [],
180
180
  ),
@@ -194,7 +194,7 @@ export class StoreProvider<Data> extends ExtendableStoreAdapter<
194
194
  type: "transformAction",
195
195
  data: {
196
196
  key: await key,
197
- args,
197
+ args: JSON.stringify(args),
198
198
  },
199
199
  sameOrigin,
200
200
  }
@@ -208,9 +208,10 @@ export class StoreProvider<Data> extends ExtendableStoreAdapter<
208
208
  event.type === "transformAction" &&
209
209
  event.data.key === (await key)
210
210
  ) {
211
+ console.log(event.data.args);
211
212
  return {
212
213
  ...event,
213
- predicate: await transform(event.data.args),
214
+ predicate: await transform(JSON.parse(event.data.args)),
214
215
  callback: callbacks.get(event.id),
215
216
  };
216
217
  }