GithubHelp home page GithubHelp logo

Comments (3)

anish000kumar avatar anish000kumar commented on May 18, 2024

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.

dragonfire1119 avatar dragonfire1119 commented on May 18, 2024

@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.

anish000kumar avatar anish000kumar commented on May 18, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.