Fork me on GitHub
#om2015-06-16
>
dnolen20:06:07

@ul if you look more closely you’ll see there are 2 render passes in Om. One for the root and another for individual components. Note all of this stuff is subject to change and has already been changed for Om Next.

ul20:06:36

could you briefly explain, where is component rerender is triggered if only its state has been changed and not app state or anything else?

ul20:06:04

i use custom atom for state which does not notify watches if values has not been changed

ul20:06:29

and i think this plays bad with my component which rely on updating its state

ul20:06:51

component's state i mean

dnolen20:06:31

@ul component local state and app state are not connected in anyway by default

dnolen20:06:43

again this isn’t any different from React

dnolen20:06:59

it’s worth spending some time understanding exactly what React guarantees

dnolen20:06:12

Om just copies that and adds extra stuff

ul20:06:17

so, component rerender on local-state-only-change is handled by React itself?

dnolen20:06:03

just similar semantics

ul20:06:17

so i can't see the place in code which guarantees that rerender

dnolen20:06:23

if you want to understand what the semantics are read the React documentation

dnolen20:06:34

you can but I’m not going to explain the whole thing in this channel simple_smile

ul20:06:03

just throw a link to line in the code into me

dnolen20:06:17

sorry I really don’t have time to do code walk through right now

ul20:06:27

okay, thanks anyway

dnolen20:06:38

if you just want to understand the guarantees I’ve already explained them

dnolen20:06:43

swapping atom renders from root

dnolen20:06:51

setting state only re-renders a single component

dnolen20:06:02

swapping references cursors only updates components watching the ref cursor path

dnolen20:06:03

that’s it

ul21:06:15

i created minimal case and issue because second guarantee is not satisfied in my case https://github.com/ul/om-local-state-re-render/blob/master/src/om_rerender_on_local_state_update/core.cljs

dnolen21:06:44

@ul right the watches have to get triggered, but this is not something we’re going to fix as I see no rationale for making this work at least in the old way of doing things.