2017-07-11 20:17:00 +02:00
|
|
|
import { TICK, ADD } from 'constants/actionTypes'
|
|
|
|
|
|
|
|
export const addCount = () => ({ type: ADD })
|
|
|
|
|
|
|
|
export const setClock = (light, ts) => ({ type: TICK, light, ts })
|
|
|
|
|
2018-12-17 17:34:32 +01:00
|
|
|
export const serverRenderClock = isServer => dispatch =>
|
|
|
|
dispatch(setClock(!isServer, Date.now()))
|
2017-07-11 20:17:00 +02:00
|
|
|
|
2018-12-17 17:34:32 +01:00
|
|
|
export const startClock = () => dispatch =>
|
|
|
|
setInterval(() => dispatch(setClock(true, Date.now())), 800)
|