Fork me on GitHub
#reagent
<
2015-10-31
>
nowprovision07:10:55

working through reagent codebase does .' have any special meaning other than a js fn named ' ?

nowprovision07:10:20

template.cljs:L205

nowprovision08:10:09

Do I have this right, when an ratom changes, it knows what components depend on it, so then it call render on these components, in component.cljs re-agent has wrapped render which now queues each render, then on requestanimationframe we sort the queue by where the components live in the tree and try to remove any that would be taken care of by an ancestor already in the queue and then render tehse

mikethompson12:10:59

Conceptually right. But details a bit mixed.

mikethompson12:10:33

When a component renders, it accumulates a list of all the ratoms derefed during the execution of the renderer. It then watches those ratoms. When any of these ratoms are changed, it queues itself to be rendered on the next animation frame.

mikethompson12:10:30

Also, to answer your earlier question on js interop, I'd point you to: https://github.com/reagent-project/reagent/blob/master/src/reagent/interop.clj

mikethompson12:10:24

.' is a macro but it is now deprecated. It has been replaced by the macro $ (because of this issue https://github.com/reagent-project/reagent/issues/196)