2017-07-13 18:55:29 +00:00
|
|
|
export const actionTypes = {
|
|
|
|
FAILURE: 'FAILURE',
|
|
|
|
INCREMENT: 'INCREMENT',
|
2018-05-16 08:47:12 +00:00
|
|
|
DECREMENT: 'DECREMENT',
|
|
|
|
RESET: 'RESET',
|
2017-07-13 18:55:29 +00:00
|
|
|
LOAD_DATA: 'LOAD_DATA',
|
|
|
|
LOAD_DATA_SUCCESS: 'LOAD_DATA_SUCCESS',
|
|
|
|
START_CLOCK: 'START_CLOCK',
|
|
|
|
TICK_CLOCK: 'TICK_CLOCK'
|
|
|
|
}
|
|
|
|
|
|
|
|
export function failure (error) {
|
|
|
|
return {
|
|
|
|
type: actionTypes.FAILURE,
|
|
|
|
error
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export function increment () {
|
|
|
|
return {type: actionTypes.INCREMENT}
|
|
|
|
}
|
|
|
|
|
2018-05-16 08:47:12 +00:00
|
|
|
export function decrement () {
|
|
|
|
return {type: actionTypes.DECREMENT}
|
|
|
|
}
|
|
|
|
|
|
|
|
export function reset () {
|
|
|
|
return {type: actionTypes.RESET}
|
|
|
|
}
|
|
|
|
|
2017-07-13 18:55:29 +00:00
|
|
|
export function loadData () {
|
|
|
|
return {type: actionTypes.LOAD_DATA}
|
|
|
|
}
|
|
|
|
|
|
|
|
export function loadDataSuccess (data) {
|
|
|
|
return {
|
|
|
|
type: actionTypes.LOAD_DATA_SUCCESS,
|
|
|
|
data
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export function startClock () {
|
|
|
|
return {type: actionTypes.START_CLOCK}
|
|
|
|
}
|
|
|
|
|
|
|
|
export function tickClock (isServer) {
|
|
|
|
return {
|
|
|
|
type: actionTypes.TICK_CLOCK,
|
|
|
|
light: !isServer,
|
|
|
|
ts: Date.now()
|
|
|
|
}
|
|
|
|
}
|