Created
December 20, 2016 21:23
-
-
Save mihailsitnic/d4dcf3f3d2f7aaa3f426de930fe26ad2 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
friendsActions.js 1 / 16 | |
import { REQUEST_FRIENDS, | |
RECEIVE_FRIENDS, | |
MIN_TIME_TO_REFETCH, | |
} from '../constants/friends.js'; | |
//import friends from '../FakeData/friends'; | |
export function fetchFriends() { | |
return function(dispatch) { | |
dispatch(requestFriends()); | |
return new Promise(requestFriendsFB) | |
.then(response => fbFriendsAdapter(response)) | |
.then(data => dispatch(receiveFriends(data))) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment