Skip to content

36 Redux

Jagdeep Singh edited this page Jul 1, 2019 · 1 revision

Redux


Terms:

==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

Description

==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 Reducer can create/manipulate State

    • in order to manipulate state, reducer needs an Action, defines state changes.

Clone this wiki locally