Skip to content

Instantly share code, notes, and snippets.

@slorber
slorber / runtimer.js
Last active September 13, 2025 12:13
function* runTimer(getState) {
while(yield take('START')) {
while(true) {
const {stop, tick} = yield race({
stop : take('STOP'),
tick : call(wait, ONE_SECOND);
})
if ( !stop ) {
yield put(actions.tick());