Skip to content

Instantly share code, notes, and snippets.

@panvourtsis
Created June 9, 2017 18:14
Show Gist options
  • Save panvourtsis/befec3ce0f3d19b83935bc15190cb305 to your computer and use it in GitHub Desktop.
Save panvourtsis/befec3ce0f3d19b83935bc15190cb305 to your computer and use it in GitHub Desktop.
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