18 lines
436 B
JavaScript
18 lines
436 B
JavaScript
|
|
const REQUEST = 'REQUEST';
|
|
const SUCCESS = 'SUCCESS';
|
|
const FAILURE = 'FAILURE';
|
|
|
|
function createRequestTypes(base) {
|
|
const res = {};
|
|
[REQUEST, SUCCESS, FAILURE].forEach(type => res[type] = `${ base }_${ type }`);
|
|
return res;
|
|
}
|
|
|
|
// Login events
|
|
export const LOGIN = createRequestTypes('LOGIN');
|
|
export const LOGOUT = 'LOGOUT'; // logout is always success
|
|
|
|
export const INCREMENT = 'INCREMENT';
|
|
export const DECREMENT = 'DECREMENT';
|