-
-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not compatible with reactotron #8
Comments
In cases where you need use to 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; |
@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. |
@dragonfire1119 Reactron seems to be extensible. I guess you can create an issue for compatibility with Redux box there as well. |
Reactotron uses it's own createStore which is not compatible with redux-box createStore. You can see a break down of how reactotron works here https://github.com/infinitered/reactotron/blob/master/docs/plugin-redux.md
Also the redux-saga reactotron plugin is not compatible either it doesn't seem like. https://github.com/infinitered/reactotron/blob/master/docs/plugin-redux-saga.md
The text was updated successfully, but these errors were encountered: