2 ms·
What you're describing isn't much different than the use of thunks generally... export const getArticle => event => async (dispatch, getState) => { c
by tracker1 8y ago
What you're describing isn't much different than the use of thunks generally...
export const getArticle => event => async (dispatch, getState) => {
const id = event.target.dataset.id;
...same as yours...
}
...
<button
data-id={record.id}
onClick={this.props.getArticle}
...
The main difference is this works out of the box with connect, and can often be bound directly against a given event handler.
- deleted 8y ago[deleted]