Closed hoshinokanade closed 4 years ago
on the other hand, Ref.$modelId
and Ref.$modelType
is also missing from intellisense.
Even with getSnapshot(myRef)
, the type hint is SnapshotOutOfObject<Ref<MyModel>>
, which I expect it should be SnapshotOutOfModel<Ref<MyModel>>
. I don't know whether it is by-design or not.
Which IDE are you using? In theory a model .id (as well as .$modelId and $modelType should be accessible out of the box.
Could you also paste some code?
I checked my package.json and is now able to make it to display correctly. Seems my "globally installed" typescript version was too old. If anyone is encountering the same issue, run tsc -v
and ensure you get > 3.9
I want to access the underlying id that the Ref is pointing to.
Ref.d.ts
Looks like that we could access Ref.id but it indeed didn't show up in intellisense. When serialized into json after getting snapshot,
Is this intentional? I am trying to explicitly fire some (easily serializable) events. In those events, I want to carry the underlying id of what Ref is trying to reference to.
typescript 3.9.5 mobx-keystone 0.45.1