Last active
May 2, 2016 21:51
-
-
Save denisraslov/3a49982cb454bb125f5f26fb5b2764ce to your computer and use it in GitHub Desktop.
redux-thunk dispatch example
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
import React from 'react' | |
import { getUser } from 'actions' | |
class MyComponent extends React.Component { | |
//... | |
// Dispatch the imported action function with the Dispatcher | |
// that you have because of react-redux. | |
getUser(id) { | |
this.props.dispatch(getUser(id)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment