@cascateer/core 2.3.11 → 2.3.12
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/operators/multicast.ts +10 -7
- package/src/store.ts +3 -3
package/package.json
CHANGED
|
@@ -18,14 +18,14 @@ interface MulticastActions<Data> {
|
|
|
18
18
|
seedAction: {
|
|
19
19
|
predicate: () => Data;
|
|
20
20
|
data: {
|
|
21
|
-
seed:
|
|
21
|
+
seed: string;
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
24
|
transformAction: {
|
|
25
25
|
predicate: Transform<Data>;
|
|
26
26
|
data: {
|
|
27
27
|
key: string;
|
|
28
|
-
args:
|
|
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
|
|
55
|
+
export interface MulticastConnectMessageData {
|
|
56
56
|
key: string;
|
|
57
|
-
seed:
|
|
57
|
+
seed: string;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
export type MulticastConnectMessage
|
|
60
|
+
export type MulticastConnectMessage = MulticastBaseMessage<
|
|
61
61
|
"connect",
|
|
62
|
-
MulticastConnectMessageData
|
|
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: {
|
|
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
|
}
|
|
@@ -210,7 +210,7 @@ export class StoreProvider<Data> extends ExtendableStoreAdapter<
|
|
|
210
210
|
) {
|
|
211
211
|
return {
|
|
212
212
|
...event,
|
|
213
|
-
predicate: await transform(event.data.args),
|
|
213
|
+
predicate: await transform(JSON.parse(event.data.args)),
|
|
214
214
|
callback: callbacks.get(event.id),
|
|
215
215
|
};
|
|
216
216
|
}
|