Skip to content

Instantly share code, notes, and snippets.

@JonJam
Last active October 27, 2017 06:57
Show Gist options
  • Save JonJam/d4e29d0bee082199728c183ea4bb332a to your computer and use it in GitHub Desktop.
Save JonJam/d4e29d0bee082199728c183ea4bb332a to your computer and use it in GitHub Desktop.
react-redux-ts: Actions types
export enum ActionTypeStates {
INPROGRESS = "_INPROGRESS",
SUCCESS = "_SUCCESS",
FAIL = "_FAIL"
}
enum ActionTypeKeys {
SIGNIN_INPROGRESS = "SIGNIN_INPROGRESS",
SIGNIN_SUCCESS = "SIGNIN_SUCCESS",
SIGNIN_FAIL = "SIGNIN_FAIL",
SIGNOUT_INPROGRESS = "SIGNOUT_INPROGRESS",
SIGNOUT_SUCCESS = "SIGNOUT_SUCCESS",
SIGNOUT_FAIL = "SIGNOUT_FAIL"
}
export default ActionTypeKeys;
import {
ISignInFailAction,
ISignInInProgressAction,
ISignInSuccessAction
} from "./authentication/signin";
import {
ISignOutFailAction,
ISignOutInProgressAction,
ISignOutSuccessAction
} from "./authentication/signout";
type ActionTypes =
| ISignInFailAction
| ISignInInProgressAction
| ISignInSuccessAction
| ISignOutFailAction
| ISignOutInProgressAction
| ISignOutSuccessAction;
export default ActionTypes;
import keys from "../../ActionTypeKeys";
export interface ISignInSuccessAction {
readonly type: keys.SIGNIN_SUCCESS;
}
export interface ISignInInProgressAction {
readonly type: keys.SIGNIN_INPROGRESS;
}
export interface ISignInFailAction {
readonly type: keys.SIGNIN_FAIL;
readonly payload: {
readonly error: Error;
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment