Fork me on GitHub
#om
<
2017-05-17
>
alexandergunnarson18:05:36

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.

alexandergunnarson18:05:27

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.

alexandergunnarson18:05:03

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

petterik19:05:18

@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

dvingo22:05:01

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

dvingo22:05:40

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