Skip to content

Instantly share code, notes, and snippets.

@tstirrat15
Last active April 6, 2017 19:18
Show Gist options
  • Save tstirrat15/a5fa88698151ca2370aba7b17d2e6502 to your computer and use it in GitHub Desktop.
Save tstirrat15/a5fa88698151ca2370aba7b17d2e6502 to your computer and use it in GitHub Desktop.
export const onSubmit = (values, dispatch, props) => (
dispatch(patchOfferCall(props.offerID, values))
);
const mapStateToProps = state => ({ offerID: state.offer.get('pk') });
export const offerFormSubmitDecorator = component => {
const connectedComponent = connect(mapStateToProps)(component);
return (props) => <connectedComponent {...props} onSubmit={onSubmit} />;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment