Skip to content

Commit

Permalink
Add a payload to actions that are dispatched (start and success)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alice Breton committed Sep 22, 2017
1 parent 3ed1575 commit 4646452
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/reduxEnhancer.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,13 @@ export const enhanceActionCreators = (

return {
...reducedObject,
[`request${pascalCaseActionTitle}Start`]: () => ({
[`request${pascalCaseActionTitle}Start`]: (payload) => ({
type: actionTypes && actionTypes.REQUEST[actionTitle].START,
payload
}),
[`request${pascalCaseActionTitle}Success`]: () => ({
[`request${pascalCaseActionTitle}Success`]: (payload) => ({
type: actionTypes && actionTypes.REQUEST[actionTitle].SUCCESS,
payload
}),
[`request${pascalCaseActionTitle}Failed`]: () => ({
type: actionTypes && actionTypes.REQUEST[actionTitle].FAILED,
Expand Down

0 comments on commit 4646452

Please sign in to comment.