import { createStore, createEvent } from 'effector'
import { interval } from 'patronum'
const startCounter = createEvent();
const stopCounter = createEvent();
const $counter = createStore(0);
const { tick } = interval({ timeout: 500, start: startCounter, stop: stopCounter });
$counter.on(tick, (number) => number + 1);
$counter.watch(value => console.log("COUNTER", value));
startCounter();
setTimeout(() => {
stopCounter();
}, 5000)