-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
09694b2
commit 4099008
Showing
13 changed files
with
362 additions
and
28 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# S8 - React Redux | ||
|
||
React Context API | ||
- Provider: 1 | ||
- Consumers: nhiều | ||
|
||
Redux: lib - npm package: redux | ||
- store | ||
- action: object {type: '', payload: ''} | ||
- reducer | ||
|
||
|
||
Multiple Reducers --> combined reducers | ||
Add todo list reducer | ||
|
||
|
||
react | ||
react-dom | ||
redux | ||
|
||
react-redux: install package | ||
HOC: Higher Order Component |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,3 +57,7 @@ | |
} | ||
} | ||
} | ||
|
||
.hero-item.active { | ||
color: deeppink; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
// Counter | ||
export const INCREMENT = 'increment' | ||
export const DECREMENT = 'decrement' | ||
|
||
// Hero | ||
// export |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { INCREMENT, DECREMENT } from "./actionType" | ||
|
||
export const increaseCounter = () => { | ||
return { | ||
type: INCREMENT, | ||
} | ||
} | ||
|
||
export const decreaseCounter = () => { | ||
return { | ||
type: DECREMENT, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
export const addHero = (hero) => { | ||
return { | ||
type: 'ADD_HERO', | ||
payload: hero, | ||
} | ||
} | ||
|
||
export const removeHero = (heroId) => { | ||
return { | ||
type: 'REMOVE_HERO', | ||
payload: heroId, | ||
} | ||
} | ||
|
||
export const setActiveHero = (hero) => { | ||
return { | ||
type: 'SET_ACTIVE_HERO', | ||
payload: hero, | ||
} | ||
} | ||
|
||
export const getHeroList = () => { | ||
// Call API | ||
// Update redux store by dispatching an action | ||
} |
Oops, something went wrong.