Created
June 9, 2017 18:14
-
-
Save panvourtsis/befec3ce0f3d19b83935bc15190cb305 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
import callApi from "../common/utils/apiCaller"; | |
export const ADD_RATINGS = "ADD_RATINGS"; | |
export function addRatings(ratings) { | |
return { | |
type: ADD_RATINGS, | |
ratings, | |
}; | |
} | |
export function fetchRatings() { | |
return (dispatch) => { | |
return callApi("ratings").then(ratings => { | |
dispatch(addRatings(ratings)); | |
}); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment