You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Property '$on' does not exist on type '{ y: number; }'
I recognize this example code won't work if the initial value of x is undefined, but if it's present, .$on works fine, so it would be nice if the type system reflected this.
The text was updated successfully, but these errors were encountered:
Yeah this is unfortunately true. Sadly there is no way (at the moment) to define different types on setting vs getting with proxy objects (see: microsoft/TypeScript#43826). I'll leave this open to encourage us to look into it further as other options arise.
Let's say I make this reactive object:
And then I want to observe the value of
x.y
:I get a TypeScript error:
I recognize this example code won't work if the initial value of
x
isundefined
, but if it's present,.$on
works fine, so it would be nice if the type system reflected this.The text was updated successfully, but these errors were encountered: