Cljs Re-frame: what’s the recommended architecture for a game loop or timer?

Viewed 134

Within the context of re-frame’s interceptor, coeffects / effects concepts I’m wondering what the recommended architectural approach is for events that are driven by a timer / cyclical event.

In one of the github examples a clock is made by defining a top level JavaScript interval at the namespace level (essentially a global).

In react this is the type of thing you would organize using component lifecycle hooks. What is a recommended way of organizing these types of event drivers (timers and request animation frame game loops)?

0 Answers
Related