Skip to content

Commit d051577

Browse files
committed
fix(reactant-module): fix subscriptions default value
1 parent 3d78eb8 commit d051577

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

packages/reactant-module/src/core/createStore.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,13 @@ export function createStore<T = any>({
251251
`);
252252
}
253253
}
254-
if (Array.isArray(service[subscriptionsKey])) {
255-
subscriptions.push(service[subscriptionsKey]!);
254+
if (!Array.isArray(service[subscriptionsKey])) {
255+
// support any subscriptions with ref
256+
Object.assign(service, {
257+
[subscriptionsKey]: [],
258+
});
256259
}
260+
subscriptions.push(service[subscriptionsKey]!);
257261
Object.defineProperties(service, {
258262
[modulesKey]: {
259263
enumerable: false,

packages/reactant-share/src/createApp.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/no-explicit-any */
12
/* eslint-disable @typescript-eslint/no-empty-function */
23
/* eslint-disable no-param-reassign */
34
/* eslint-disable no-shadow */
@@ -310,6 +311,7 @@ export const createSharedApp = async <
310311
);
311312
}
312313
const { bootstrap } = app;
314+
// todo: app.destroy with transport destroy
313315
return {
314316
...app,
315317
bootstrap: async (...args: S) => {

0 commit comments

Comments
 (0)