Hey everybody, I'm new with Qwik and I was trying to implement a simple timer. However I ran into a problem, which I do not know how to solve with Qwik.
I have 3 functions: runTimer, pauseTimer and decrement.
runTimer invokes decrement with a setInterval.
pauseTimer clears the interval.
decrement decrements the timer and when the timer is 0, it will do stuff and invoke runTimer again.
So runTimer should be able to invoke decrement and vice versa. However as they are not defined via the function foo() {} annotation but the const foo = $(() => {}); annotation. Hence the order of declaration matters. But since they can both invoke each other, it will always be a problem.
Is there any other way in Qwik to solve this problem? I will try to post a stripped example, but it seems to be too long for Discord.