These are chat archives for canjs/canjs

22nd
Jun 2018
Chasen Le Hara
@chasenlehara
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). https://canjs.com/doc/can-observation.html
Julian
@pYr0x
Jun 22 2018 16:21
@justinbmeyer as i see right now in the donejs meetup
your comments are not shown to us in https://github.com/donejs/bitcentive/pull/349/files
they are on "pending"
RyanMilligan
@RyanMilligan
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
@justinbmeyer
Jun 22 2018 16:45
on "pending"?
oooh
submitted
thanks!
@pYr0x is it working now?
Julian
@pYr0x
Jun 22 2018 16:46
yes
thanks
i think on the other PR there were on pending as well
Justin Meyer
@justinbmeyer
Jun 22 2018 16:48
it doesn't show them as pending for me
Julian
@pYr0x
Jun 22 2018 16:49
ok they are visible
;)
Kevin Phillips
@phillipskevin
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: https://github.com/canjs/can-devtools-components/blob/6075bfe2282f80fdbb081384245e2a86b9125092/viewmodel-editor/viewmodel-editor.js#L65-L102