Skip to content

Commit ebb0157

Browse files
committed
step 3 tests passing
1 parent fdcad0a commit ebb0157

File tree

8 files changed

+61
-379
lines changed

8 files changed

+61
-379
lines changed

README.md

Lines changed: 9 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
A [CodeRoad](https://coderoad.github.io) tutorial for learning Redux.
44

5+
<!-- @import('01') -->
6+
<!-- @import('02') -->
7+
<!-- @import('04') -->
8+
<!-- @import('05') -->
9+
<!-- @import('06') -->
10+
<!-- @import('07') -->
11+
<!-- @import('08') -->
12+
<!-- @import('09') -->
13+
514

615
## CodeRoad
716

@@ -19,33 +28,6 @@ CodeRoad is an open-sourced interactive tutorial platform for the Atom Editor. L
1928

2029
## Outline
2130

22-
##### Project Setup
23-
24-
Getting a project setup is rarely easy. Luckily, we have a quick script that can do the work for us.
25-
26-
---
27-
28-
Running `> npm run setup` will do the following:
29-
30-
1. Install package dev dependencies
31-
2. Create an output directory called "dist"
32-
3. Install "concurrently" & "browser-sync" globally
33-
4. Run our app in the browser
34-
35-
You'll find this "setup" script located in your *package.json*.
36-
37-
---
38-
39-
We'll be installing a lot of scripts from terminal. You may also want to consider installing the atom package ["platformio-ide-terminal"](https://github.com/platformio/platformio-atom-ide-terminal), which provides a terminal inside your editor.
40-
41-
##### The Store
42-
43-
The "single source of truth".
44-
45-
```js
46-
const store = createStore(reducer, initialState);
47-
```
48-
4931
##### Actions
5032

5133
Events that change the data.
@@ -66,45 +48,3 @@ const actionName = () => ({ type: 'ACTION_NAME' });
6648
```js
6749
const ACTION_NAME = 'ACTION_NAME'
6850
```
69-
70-
##### Reducer
71-
72-
The data transformation
73-
74-
```js
75-
const reducer = (state) => {
76-
console.log(state);
77-
return state;
78-
};
79-
```
80-
81-
##### Combine Reducers
82-
83-
Using thunks for async actions.
84-
85-
##### Middleware
86-
87-
Using thunks for async actions.
88-
89-
##### Second Action
90-
91-
Creating a "SORT_BY_POPULARITY" action.
92-
93-
```js
94-
function sortByVotes(a, b) {
95-
switch(true) {
96-
case a.votes < b.votes:
97-
return 1;
98-
case a.votes > b.votes:
99-
return -1;
100-
default:
101-
return 0;
102-
}
103-
}
104-
```
105-
106-
Sort pokemon by votes
107-
108-
##### Thunk
109-
110-
Using thunks for async actions.

0 commit comments

Comments
 (0)