authelia/client/src/reducers/Portal/Authentication/actions.ts

20 lines
603 B
TypeScript
Raw Normal View History

2019-01-20 02:10:43 +07:00
import { createAction } from 'typesafe-actions';
import {
FETCH_STATE_REQUEST,
FETCH_STATE_SUCCESS,
FETCH_STATE_FAILURE,
} from "../../constants";
import RemoteState from '../../../views/AuthenticationView/RemoteState';
/* FETCH_STATE */
export const fetchState = createAction(FETCH_STATE_REQUEST);
export const fetchStateSuccess = createAction(FETCH_STATE_SUCCESS, resolve => {
return (state: RemoteState) => {
return resolve(state);
}
});
export const fetchStateFailure = createAction(FETCH_STATE_FAILURE, resolve => {
return (err: string) => {
return resolve(err);
}
});