Fork me on GitHub
#rum
<
2017-03-05
>
jrychter13:03:39

I am finding that the following mixin does wonders to my performance:

(def static-nofn
  {:should-update
   (fn [old-state new-state]
     (not= (filter (complement fn?) (:rum/args old-state)) (filter (complement fn?) (:rum/args new-state)))) })

jrychter13:03:22

(if you pass anonymous functions to components, they are never =, so any component which has any fn args will never be rum/static)

kauko13:03:46

Thanks for sharing!

kauko13:03:13

Did you measure the impact?

jrychter13:03:39

I measure the impact in a very scientific "visual" way: my table is either dog-slow or not 🙂

jrychter13:03:16

It doesn't matter unless you have lots of components that are suddenly being re-rendered.