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
In your type definitions, the ObservableSlim.create() function returns a type ProxyConstructor. I think this is incorrect. ProxyConstructor is just a type defined explicitly for the object Proxy, and all it can do is be constructed, i.e. new Proxy(...).
If I run:
let x = {} as MyState
let state = ObservableSlim.create(x, true, changes => {
console.log('State changed', changes);
});
x.y = 3;
I would expect state to be of type MyState, or possibly object, but definitely not ProxyConsructor. I get an error on the last line, even if the type MyState has a property x. If you construct a Proxy, it will be of the same type as the first argument, so I think create should world the same way.
The text was updated successfully, but these errors were encountered:
In your type definitions, the
ObservableSlim.create()
function returns a typeProxyConstructor
. I think this is incorrect.ProxyConstructor
is just a type defined explicitly for the objectProxy
, and all it can do is be constructed, i.e.new Proxy(...)
.If I run:
I would expect state to be of type
MyState
, or possiblyobject
, but definitely notProxyConsructor
. I get an error on the last line, even if the typeMyState
has a propertyx
. If you construct a Proxy, it will be of the same type as the first argument, so I thinkcreate
should world the same way.The text was updated successfully, but these errors were encountered: