Fork me on GitHub
#re-frame
<
2023-12-20
>
Akiz18:12:54

Hi, I needed to slow down third-layer sub and I’ve done it based on https://clojurians.slack.com/archives/C073DKH9P/p1600030259023900. Will the flows be better for this, will it support an interval (debouncing)?

Kimo12:12:40

Seems like you could dispatch an event at regular intervals, then control the flow somehow so it's only live when that event runs. Then you'd have that kind of debouncey behavior where the calculation only runs on that particular event.

Kimo12:12:00

A flow can have an input from the same app-db path as its output. Maybe that comes in handy too. A flow could output a value that causes it to become dead. Then, your event could make it live again, perhaps by registering it. Worth playing around with, maybe a nice pattern will emerge.

Kimo12:12:07

Your :output function could return something like this: {:value "your calculation result" :dirty? false}. Then other events could set :dirty? true at the right time. And your :live? function could basically be a getter for that :dirty value.

👍 1