- Notifications
You must be signed in to change notification settings - Fork0
ShMcK/coderoad-redux-js
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
ACodeRoad tutorial for learning Redux.
CodeRoad is an open-sourced interactive tutorial platform for the Atom Editor. Learn more atCodeRoad.io.
install the tutorial package
npm install --save coderoad-redux-js
install and run theatom-coderoad plugin
Getting a project setup is rarely easy. Luckily, we have a quick script that can do the work for us.
Running> npm run setup
will do the following:
- Install package dev dependencies
- Create an output directory called "dist"
- Install "concurrently" & "browser-sync" globally
- Run our app in the browser
You'll find this "setup" script located in yourpackage.json.
We'll be installing a lot of scripts from terminal. You may also want to consider installing the atom package"platformio-ide-terminal", which provides a terminal inside your editor.
The "single source of truth".
conststore=createStore(reducer,initialState);
Events that change the data.
constaction={type:'ACTION_NAME'};
constactionName=()=>({type:'ACTION_NAME'});
constACTION_NAME='ACTION_NAME'
The data transformation
constreducer=(state)=>{console.log(state);returnstate;};
Reducers must be pure functions
State is "read only".
Notes
constnextPokemon=state.pokemon.map(p=>{if(id===p.id){p.votes+=1;}returnp;});return{pokemon:nextPokemon};
Create modular, composable reducers withcombineReducers
.
About
CodeRoad tutorial for learning Redux
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.