Skip to content

Commit 83d4963

Browse files
authored
cleanup and simplify bootstrap store setup
1 parent c2d4108 commit 83d4963

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

bootstrap/src/store/index.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { all, fork } from "redux-saga/effects";
55

66
import {
77
setStore,
8+
getStore,
89
sharedReducer,
910
envReducer,
1011
modulesReducer,
@@ -49,12 +50,11 @@ export default (router, fetchContext, bootstrapMiddlewares) => {
4950
modules: modulesReducer,
5051
});
5152

52-
const store = createStore(reducer, {}, composer(...[applyMiddleware(...enhancers)]));
53+
const store = createStore(reducer, {}, composer(applyMiddleware(...enhancers)));
5354
setStore(store);
5455

55-
const sagas = [watchBootstrap, watchFetchContext, watchRefresh];
56-
runSaga(store, function* rooSaga() {
57-
yield all(sagas.map(fork));
56+
runSaga(getStore(), function* rooSaga() {
57+
yield all([watchBootstrap(), watchFetchContext(), watchRefresh()]);
5858
});
5959

6060
return store;

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@lastui/rocker",
3-
"version": "0.19.28",
3+
"version": "0.19.29",
44
"license": "Apache-2.0",
55
"author": "[email protected]",
66
"homepage": "https://github.com/lastui/rocker#readme",

0 commit comments

Comments
 (0)