Skip to content

Instantly share code, notes, and snippets.

@rogerwschmidt
Created May 18, 2018 16:19
Show Gist options
  • Select an option

  • Save rogerwschmidt/33025771b99a991b60838e00458779c8 to your computer and use it in GitHub Desktop.

Select an option

Save rogerwschmidt/33025771b99a991b60838e00458779c8 to your computer and use it in GitHub Desktop.

React and Redux part 2 Instructor Notes

Objectives

  • Install thunk and add it as a middleware to redux
  • Use thunk in actions to do AJAX calls

Resources

How do you install thunk

  • npm install redux-thunk
  • import applyMiddleware from redux
  • use applyMiddleware in createReducer

How do you use Thunk

  • Create action to GET_ALL items from the backend
  • Trigger action in TodoList lifecycle method componentDidMount
  • Update action ADD to work with the API
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment