These are chat archives for canjs/canjs

Jun 2018
Chasen Le Hara
Jun 22 2018 00:48
@RyanMilligan Hm… would you mind filing an issue for unwrap not being in the docs… I’m not sure if it’s intentionally undocumented or not.
I wonder if can-observation would work for your use case… create an observation that returns the results of unwrap (or something like that).
Jun 22 2018 16:21
@justinbmeyer as i see right now in the donejs meetup
your comments are not shown to us in
they are on "pending"
Jun 22 2018 16:30
@chasenlehara I'm already in an observation context, so I would expect canReflect.unwrap() to already handle all the observation aspects of the problem. The value updates if I change a property directly on the object I passed to unwrap(), but not if I change a property on a nested object. I'll set up a minimal repro and log an issue.
Justin Meyer
Jun 22 2018 16:45
on "pending"?
@pYr0x is it working now?
Jun 22 2018 16:46
i think on the other PR there were on pending as well
Justin Meyer
Jun 22 2018 16:48
it doesn't show them as pending for me
Jun 22 2018 16:49
ok they are visible
Kevin Phillips
Jun 22 2018 17:07

I forgot at the Contributor's Meeting that I wanted to show the code for how the JSON is updated in the ViewModel Editor in Devtools.

It was interesting because changes come in from the ViewModel changing in the app and changes also happen when the user edits the JSON in the jsoneditor (third-party plugin) we're using. And both could be changing at the same time.

Whichever one changes, we have to find the patches for what changed and apply it to the other one. It was a good use-case for the value resolver observable in DefineMap. Here's the code if you want to take a look: