Last active
November 27, 2018 18:16
-
-
Save ger86/55243dc2f138235970655ee86df12176 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export function getPostsThunk(params) { | |
| return async dispatch => { | |
| try { | |
| const res = await dispatch(createRequest(getPosts(params))); | |
| const posts = res.data; | |
| dispatch({ | |
| type: GET_POSTS_SUCCEEDED, | |
| payload: treasures | |
| }); | |
| } catch (error) { | |
| throw createApiError(error); | |
| } | |
| }; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment