actions.js 717 Bytes
Newer Older
1 2 3 4 5
import {
  LOAD_REPOS,
  LOAD_REPOS_ERROR,
  LOAD_REPOS_SUCCESS,
  SET_AUTHORITY,
6
  SET_USER_MODE,
张烨's avatar
张烨 committed
7
  SET_LOGIN_NAME,
8
} from './constants';
Julien Benchetrit's avatar
Julien Benchetrit committed
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29

export function loadRepos() {
  return {
    type: LOAD_REPOS,
  };
}

export function reposLoaded(repos, username) {
  return {
    type: LOAD_REPOS_SUCCESS,
    repos,
    username,
  };
}

export function repoLoadingError(error) {
  return {
    type: LOAD_REPOS_ERROR,
    error,
  };
}
30 31 32 33 34 35 36

export function setAuth(auth) {
  return {
    type: SET_AUTHORITY,
    auth,
  };
}
37 38 39 40 41 42 43

export function setUserMode(userMode) {
  return {
    type: SET_USER_MODE,
    userMode,
  };
}
张烨's avatar
张烨 committed
44 45 46 47 48 49 50

export function setLoginName(loginName) {
  return {
    type: SET_LOGIN_NAME,
    loginName,
  };
}