{"size": 693, "ext": "js", "max_stars_repo_path": "frontend/src/actions/roomActions.js", "max_stars_repo_name": "vpaliy/react-chat", "max_stars_repo_stars_event_min_datetime": "2018-12-03T05:53:48.000Z", "max_stars_repo_stars_event_max_datetime": "2018-12-03T05:53:48.000Z", "max_issues_repo_path": "frontend/src/actions/roomActions.js", "max_issues_repo_name": "vpaliy/react-chat", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "frontend/src/actions/roomActions.js", "max_forks_repo_name": "vpaliy/react-chat", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 24.75, "max_line_length": 54, "alphanum_fraction": 0.6002886003}
import Promise from "bluebird";
import { Users, Rooms, Contacts } from "@requests";

export const fetchContacts = () => dispatch => {
  dispatch({ type: "contacts-start" });
  Contacts.fetchContacts()
    .then(response => {
      dispatch({
        type: "contacts-finish",
        ...response
      });
    })
    .catch(error => {});
};

export const deleteContact = contact => dispatch => {
  dispatch({ type: "contacts-delete" });
};

export const deleteUser = () => dispatch => {};
export const deleteRoom = () => dispatch => {};

export const createRoom = room => dispatch => {
  Rooms.createRoom(room).then(response => {
    dispatch({ type: "create-room", room: response });
  });
};
