4 ms·
How do Re-framers handle components that wants to redraw using a timer, such as an animation or progress bar?
by ridiculous_fish 9y ago
How do Re-framers handle components that wants to redraw using a timer, such as an animation or progress bar?
- always_good 9y agoMaybe it'd be like Elm where you can subscribe to external events, as if you were to do something like this: requestAnimationFrame(() => dispatch('TICK', Date.now() - prevTick)) Then you can feed the offset into view functions which forces a re-render and steps the animation.
- serpix 9y agoyou would normally start setInterval/whatever function somewhere and you dispatch the change to re-frame when needed. Reframe will update the db and the components subscribing to that data will redraw when a change occurs. The component(s) themselves have no coupling whatsoever to what is providing the displayed data.