om

Please ask the channel first, not @dnolen directly!
2017-05-17T18:21:36.863145Z

Hey — I have a question that I haven't been able to find a solution to online (which is pretty unusual actually). Hopefully it's a straightforward fix. The issue is this. In an onClick handler I call om/update! on a shared cursor, which sets its value to be a vector. This triggers a call to render-state on affected components. However, even though I had previously called om/observe on that cursor with respect to those components, the updated value is not reflected in those render calls, even when calling deref on the cursor in question.

2017-05-17T18:22:27.882498Z

The strange thing is that the updated value is shown in the render lifecycle functions when I click the checkbox (triggering the onClick handler) again, as well as every subsequent time.

2017-05-17T18:23:03.896537Z

(This is for om "original" version 0.9.0, not om.next)

petterik 2017-05-17T19:48:18.742352Z

@anmonteiro I think I found an issue with transform-reads where it returns multiple reads with the same "root join". One solution would be to merge the reads returned. Minimal repro: https://gist.github.com/petterik/0858c903d470be1245314c9b640a00c5

2017-05-17T22:08:01.401496Z

I put together a sample repo rendering om.next components in react storybook: https://github.com/dvingo/om-storybook-example

2017-05-17T22:08:40.410696Z

i know we can use devcards, but it's nice to leverage existing work in the JS community as well. the more options the better