2019-03-27 22:00:57 +01:00
|
|
|
import { delay, call, put, take } from 'redux-saga/effects'
|
|
|
|
import { polyfill } from 'es6-promise'
|
2018-02-25 00:17:04 +01:00
|
|
|
import 'isomorphic-unfetch'
|
|
|
|
|
|
|
|
import { actionTypes, tickClock } from './actions'
|
|
|
|
|
2019-03-27 22:00:57 +01:00
|
|
|
polyfill()
|
2018-02-25 00:17:04 +01:00
|
|
|
|
2018-08-20 08:31:24 +02:00
|
|
|
function * runClockSaga () {
|
2018-02-25 00:17:04 +01:00
|
|
|
yield take(actionTypes.START_CLOCK)
|
|
|
|
while (true) {
|
|
|
|
yield put(tickClock(false))
|
2019-03-27 22:00:57 +01:00
|
|
|
yield delay(800)
|
2018-02-25 00:17:04 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default call(runClockSaga)
|