I am trying to deal with reagent in clojurescript with a simple drawing program.
I am looking for an example of how to access the mouse position in the basic "FRP" style with Reagi .
In various reagent examples, I see things that look like this:
[:p [:onmousemove (fn (evt) ...)]]
to attach a handler to a DOM element.
And to make the Reagi behavior, I want to write something like this:
(def mouse-positions (r/behavior ( ... )))
But how do I combine these two so that the handler that I add to the DOM element loads the Reagi behavior?
Secondly, since I am using a reagent, I expect these DOM nodes to be recreated regularly. Presumably, I will need to bind the event handler to the Reagi thread again. How to provide this?
amuses
clojurescript reagent
interstar
source share