Skip to content

Instantly share code, notes, and snippets.

@RusAlex
Created November 15, 2016 16:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RusAlex/e1d14b7c09e3ecef9486f718d7d56bee to your computer and use it in GitHub Desktop.
Save RusAlex/e1d14b7c09e3ecef9486f718d7d56bee to your computer and use it in GitHub Desktop.

Redux folders

  • actions Action simple functions with payloads of information to change state. http://redux.js.org/docs/basics/Actions.html#actions
  • store folder with reducers and store initialization code. Reducers: http://redux.js.org/docs/basics/Reducers.html#reducers
  • stages or pages folder of "smart" react views. Views that connected to store with react-redux and their markup JSX. In redux terms files from the folder by default will return "redux containers". http://redux.js.org/docs/basics/UsageWithReact.html#container-components
  • components or views dumb views like Buttons or Text views.
  • selectors functions return part of store to connect with "smart" components. This is not a dogma and simple selectors can be also defined in stages/pages component files. Only one case when you create file in this folder, when you use the same part of app state in several stages/pages.
  • api - ...
  • triggers - service to that stays between stages/pages and api. It may decide where to pull data either from HTTP api component or from LocalStorage api then dispatch an action.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment