Created
May 11, 2016 20:14
-
-
Save piq9117/56cc5370f8c40e4fc3b1186917ac247f to your computer and use it in GitHub Desktop.
This file contains 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
function fetchPosts (subreddit) { | |
return dispatch => { | |
dispatch(requestPosts(subreddit)) | |
return fetch('http://www.reddit.com/r/${subreddit}.json') | |
.then(response => response.json()) | |
.then(json => dispatch(receivePosts(subreddit, json))) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment