Skip to content

Instantly share code, notes, and snippets.

@gskachkov
Created December 4, 2019 09:27
Show Gist options
  • Save gskachkov/df5311be71e934948093ac6c26e5f924 to your computer and use it in GitHub Desktop.
Save gskachkov/df5311be71e934948093ac6c26e5f924 to your computer and use it in GitHub Desktop.
export const updateObject = (id, caption) => ({
type: 'UPDATE_OBJECT',
id,
caption
})
export const thunkedUpdateObject = (id, caption) => dispatch => {
return axios
.post(...)
.then(_ => {
dispatch(updateObject(id, caption))
});
};
@gskachkov
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment