Fork me on GitHub
#rum
<
2018-04-18
>
fmn04:04:26

@escherize Sorry I didn't word it right. I didn't really know how actually react works. For example, if I have a component:

(defc b
  [message]
  [:h1 message])

(defc a
  []
  [:div (b "foobar")])
I can say for sure (b "foobar") inside a will point to previous state of the b after the first rendering. But what if a is declared using defn instead of defc. Will it create a totally new react component for b each time a re-render? Because I want to wrap my component with multimethod.
(defmulti my-component :id)

(defmethod my-component :table/user
  [option]
  (c option))

(defmethod my-component :table/role
  [option]
  (d option))
There's a "gotcha" in reagent regarding multimethod: https://stackoverflow.com/questions/33299746/why-are-multi-methods-not-working-as-functions-for-reagent-re-frame. So I'm wondering is that "wonky" things regarding multimethod also exists in rum.

Petrus Theron09:04:02

Rum performance: does Rum always re-run every function and defer to React for DOM blitting when a change is detected? What are my optimization paths when I encounter too-frequent updates on a subdividable tree? Specifically, I'm passing in a DataScript db, which changes frequently, but the queries affecting a given view don't change as frequently. Is the solution to have dumb vs. smart views that run efficient change queries and only trigger updates downstream if those query results differ?

Roman Liutikov09:04:15

yep, that’s usually the easiest way to cut re-rendering of a sub tree

danielstockton11:04:15

In other words, use :rum/static downstream right?