Skip to content

Instantly share code, notes, and snippets.

@slightlytyler
Forked from tstirrat15/blah.js
Last active April 6, 2017 19:31
Show Gist options
  • Save slightlytyler/fb9795505b965bc30d50fd557d8c9ec8 to your computer and use it in GitHub Desktop.
Save slightlytyler/fb9795505b965bc30d50fd557d8c9ec8 to your computer and use it in GitHub Desktop.
export const offerFormSubmitDecorator = Component => {
return connect(
state => ({ offerID: state.offer.get('pk') }),
dispatch => ({ patchOfferCall: (offerId, values) => dispatch(actions.patchOfferCall(offerId, values)) }),
(stateProps, dispatchProps) => ({
...stateProps,
onSubmit: values => dispatchProps.patchOfferCall(stateProps.offerId, values),
})
)
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment