Last active
June 4, 2018 15:45
-
-
Save jamesattard/a709938fc5424b43b1c3723fcd464c70 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 const fetchPostsAndComments = () => async ( | |
dispatch, | |
getState | |
) => { | |
await dispatch(fetchPostList()); | |
const PostList = await getState().post.postList; | |
await PostList.forEach(post => { | |
dispatch(fetchPostComments(post._id)); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment