Giter Site home page Giter Site logo

Reducers API about universal-redux HOT 4 CLOSED

bdefore avatar bdefore commented on September 2, 2024
Reducers API

from universal-redux.

Comments (4)

bdefore avatar bdefore commented on September 2, 2024

@dts this changed in the beta drops of 2.0, as i felt like it streamlined the process that users didn't need to know about redux-simple-router needing to be defined here, that the universal-redux library could handle it for you. how do you feel about it? i'm not entirely satisfied with it, and have been exploring other ways and may retract it before the official 2.0.

from universal-redux.

dts avatar dts commented on September 2, 2024

The ideal case, IMHO, is unfortunately the hardest one: do not require the redux-simple-router call, but allow the user to supply a normal Redux reducer function, as it maintains the API simplicity that makes redux so wonderful. Internally, it would look like this:

function universalReduxRootReducer(state,action) {
  state = { state... , _routing: routerReducer(state._routing,action) };
  state = userReducer(state,action);
}

from universal-redux.

bdefore avatar bdefore commented on September 2, 2024

@dts what you're desiring is a bit of a wrapper around the redux simple router, which i think i'd prefer to let the project developer decide how best to do. in which case, the newer API is too proscriptive, and I think it's best to return to a place where it's up to you how you and where you'd like to manage routeReducer.

from universal-redux.

bdefore avatar bdefore commented on September 2, 2024

2.0.0-beta13 returns to the previous behavior, expecting user to return a combineReducers object with redux-simple-router's routeReducer as one of them. An example: https://github.com/bdefore/universal-redux/blob/master/examples/jwt/src/redux/modules/index.js

from universal-redux.

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.