Skip to content

Instantly share code, notes, and snippets.

@ger86
Last active November 27, 2018 17:24
Show Gist options
  • Save ger86/ac083b24c0ee04f058fb9aff21a803b7 to your computer and use it in GitHub Desktop.
Save ger86/ac083b24c0ee04f058fb9aff21a803b7 to your computer and use it in GitHub Desktop.
export function getPostsThunk(params) {
return async (dispatch, getState) => {
try {
const res = await getPosts(params);
dispatch(getPostsSucceededAction(res.data));
} catch (error) {
throw createApiError(error);
}
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment