Slide 41
Slide 41 text
࣌ࠁ
const updateTime = createAction('UPDATE_TIME',
(time: Date) => ({ time: time }));
const timeReducer = handleAction(updateTime,
(state, action) => action.payload!.time, new Date() );
function * ticktack() {
while (true) {
yield put(updateTime(new Date()));
yield delay(1000);
}
}
function * rootSaga() {
yield all([
fork(ticktack),
]);
}