Comments (3)
In cases where you need use to {createStore} from 'redux'
, you can always register your modules with redux store manually:
(v1.3.9 onwards)
import {applyMiddleware,combineReducers, compose, createStore} from 'redux';
import createSagaMiddleware from "redux-saga";
import {all} from 'redux-saga/effects';
import {moduleToReducer} from 'redux-box'
import {module as homeModule} from './home'
import {module as userModule} from './user'
//hook up your module reducers
const combinedReducer = combineReducers({
home : moduleToReducer(homeModule),
user : moduleToReducer(userModule)
})
// hook up your module sagas
const sagas = [
...homeModule.sagas,
...userModule.sagas
]
// hook up your middlewares here
const sagaMiddleware = createSagaMiddleware();
const middlewares = [sagaMiddleware];
//what follows below is the usual approach of setting up store
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose
let enhancer = composeEnhancers(applyMiddleware(...middlewares))
function *rootSaga(){
yield all(sagas)
}
const store = createStore( combinedReducer, enhancer );
sagaMiddleware.run(rootSaga);
export default store;
from redux-box.
@anish000kumar Thanks for the reply! Ok I figured it would probably be more boilerplate code to hookup reactorton. Guess Ill have to weigh the advantage to that much added code against the clean code that redux-box has already.
from redux-box.
@dragonfire1119 Reactron seems to be extensible. I guess you can create an issue for compatibility with Redux box there as well.
from redux-box.
Related Issues (20)
- Babel-polyfill may collide in apps that already have it defined HOT 3
- Adding Redux Observable? HOT 4
- Allow to set the initial store HOT 7
- Include getters HOT 3
- Reselect? HOT 2
- Example with Testing HOT 1
- Support for dynamic selectors HOT 2
- extra sagas passed in via the config don't register
- Cannot read property 'sagas' of undefined HOT 3
- Redux-box + GraphQL HOT 4
- How to integrate react routerv4 web version? HOT 1
- Redux Saga effect 'select' doesn't work as expected HOT 3
- How to invoke actions from sagas HOT 2
- working with rn 0.56-0.57 / babel 7 HOT 2
- Store isn't passed to children with newer redux & react-redux versions HOT 3
- make it compatible with react-redux v6.x.x HOT 1
- Unable to resolve module `./helpers` from `node_modules/redux-box/dist/index.js` HOT 2
- Use with redux-persist HOT 13
- Improve Action creator HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from redux-box.