monet
monet copied to clipboard
What does an update function do?
Lacking docs or links to docs on what an update function is and does.
It is a structured way to update the entities value. If you look here: https://github.com/rm-hull/monet/blob/master/src/monet/canvas.cljs#L344-L350 you can see it pulls out the value and update function, and update is called with the current value and the time delta since it was last called.
I guess the original intention was that an entity value might contain screen coordinates, which get updated periodically to create movement.
This stuff predates react and om (and my involvement, TBH) - I wrote a library called big-bang a while ago which does the same sort of event-loop abstraction, but it never got much (any?) traction, so sits there unmaintained and unloved.
I only ever used monet for the canvas wrapper functions. I've half a mind to remove the entity stuff altogether, actually.