mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
9c4eefcdbf
* Add prettier for examples directory * Fix files * Fix linting * Add prettier script in case it has to be ran again
53 lines
951 B
JavaScript
53 lines
951 B
JavaScript
export const actionTypes = {
|
|
FAILURE: 'FAILURE',
|
|
INCREMENT: 'INCREMENT',
|
|
DECREMENT: 'DECREMENT',
|
|
RESET: 'RESET',
|
|
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 }
|
|
}
|
|
|
|
export function decrement () {
|
|
return { type: actionTypes.DECREMENT }
|
|
}
|
|
|
|
export function reset () {
|
|
return { type: actionTypes.RESET }
|
|
}
|
|
|
|
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()
|
|
}
|
|
}
|