Skip to content

Instantly share code, notes, and snippets.

@jamesattard
Last active June 4, 2018 15:45
Show Gist options
  • Save jamesattard/a709938fc5424b43b1c3723fcd464c70 to your computer and use it in GitHub Desktop.
Save jamesattard/a709938fc5424b43b1c3723fcd464c70 to your computer and use it in GitHub Desktop.
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