forked from codefellows/seattle-javascript-401d30
-
Notifications
You must be signed in to change notification settings - Fork 0
36 Redux
Jagdeep Singh edited this page Jul 1, 2019
·
1 revision
==Action==:
- Objects with type and payload
- Type => string explaining what the action is doing
- Payload => Optional, Any type. data for action
==Reducer==:
-
requires previous state and action
-
function that takes in previous State and applies Action, returning new State
==Store==:
- Holds State and Reducer
- Doesn't not connect to DOM.
==Provider==:
- Connects Store to DOM
- Needed because Redux is not designed for just web platform.
==Dispatch==:
- Lets you create functions that send actions to the store
==Payload==:
- Optional, any type
- whatever the action needs to do its thing
==Connect==:
- connects components to store
==Redux== is a predictable state container for JavaScript apps.
Redux stores all the information in something called store. Any component that needs the information, connects to the store using connect.
-
State comes as props to the component.
-
Only
Reducercan create/manipulate State- in order to manipulate state, reducer needs an
Action, defines state changes.
- in order to manipulate state, reducer needs an