Git Product home page Git Product logo

Comments (2)

emmenko avatar emmenko commented on June 25, 2024

Hey, glad that helps ;)

First of all I think we need to clarify the "traditional store" meaning. If you mean a store a-la Flux, well you don't need / have those in Redux.
In Redux you have basically a state object for the entire application. You can consider this as your "store". Whenever you dispatch an action, the reducer functions that you have mapped for each action will return a "new state" object with the related changes. You don't mutate anything in Redux.

If you haven't I would really recommend to really through all of the Redux documentation, it's worth it!
http://rackt.org/redux/index.html

In this app I have a 2 state objects: application and github.
https://github.com/emmenko/redux-react-router-async-example/blob/master/lib/reducers/index.js

The Redux state (or store) will then be something like { application: {...}, github: {...} }

The application state object will have then a shape described here
https://github.com/emmenko/redux-react-router-async-example/blob/master/lib/reducers/application.js#L4-L14

You see that there is a locale key, which gets updated when I dispatch the LOCALE_SWITCHED action.

In this example I'm using localStorage to persist the application state so that when I reload the page, the application starts with my previous state.

I hope this helps you a bit further ;)

from redux-react-router-async-example.

sirrodgepodge avatar sirrodgepodge commented on June 25, 2024

Thank you for your quick response, yes Redux seems very intriguing, your app is helping me understand it quite a bit :)

from redux-react-router-async-example.

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.