Closed kingpalethe closed 4 years ago
Right now there's no official sandbox, but maybe you can piggy back for example on this one to create the reproduction case?
Btw, the case where oldValue !== undefined and newValue === undefined will happen if the referenced object dissapears from the tree.
The case where oldValue === undefined and newValue !== undefined is when a referenced object that wasn't in the tree appears back again.
The case where oldValue !== undefined and newValue is !== undefined (a different value than oldValue) is when an object with a given id is replaced with a different object yet with the same id (actually I'm not sure this even happens, would need to check).
The case were both are undefined should never happen.
Closing due to inactivity, feel free to reopen if needed
We've been using references with Mobx Keystone, which work well so far: https://mobx-keystone.js.org/references
Our question is with regard to the
onResolvedValueChange
pattern:Throughout our application, we've found that
ref
andoldValue
always show the right data -- for example, we can dogetSnapshot(oldValue)
and see the previously referenced model instance.The issue is with
newValue
. This seems to always returnundefined
, no matter what we try.I wanted to check if anyone else had this issue....if not, I would like to set up a CodePen demonstrating it... but I can't find any templates where anyone has used Mobx Keystone in CodePen (or similar web based javascript environment) --- has anyone seem a template like that?