Skip to main content

All Questions

0 votes
0 answers
21 views

Typescript derives different types when a static method is called from inside or outside a class

Can someone help me explain the behavior of typescript in this example. I have no idea what is going on here. Why is childProxy1.foo not resolved while childProxy2.foo is resolved correctly? Why is ...
Micha Stubi's user avatar
1 vote
0 answers
199 views

Can I make a Mobx observable with a custom getter?

I have a need for a Mobx observable object which simply returns whichever property is asked of it as a string. For example, myObs.description would simply return the string "description". ...
Nathan's user avatar
  • 305
2 votes
1 answer
754 views

Trace method calls with javascript proxy

var handler1 = { get:function(target,key){ if (typeof target[key] == "function"){ var method = Reflect.get(target, key); return method.bind(target); ...
Ayush Goel's user avatar
0 votes
0 answers
453 views

Illegal invocation during non configurable method call with javascript proxies

I am using javascript proxies to intercept method calls to an object, however if the method is a non configurable and non writable property, I am not able to correctly intercept it var handler = { ...
Ayush Goel's user avatar
2 votes
1 answer
1k views

Illegal invocation while intercepting method calls with javascript proxy

Can someone explain the following output var handler = { get: function(target,key, receiver){ return new Proxy(Reflect.get(target, key, receiver),handler); }, apply: function(target, ...
Ayush Goel's user avatar
1 vote
0 answers
46 views

Distinguish the final property from the intermediate properties being accessed with javascript proxies

Is there a way to figure out if the property being read of a proxy object is the final property or the intermediate property. var handler = { get(target, key) { return new Proxy(target[key], ...
Ayush Goel's user avatar
4 votes
1 answer
3k views

Detect when the reference of a variable changes

I am currently writing a tool that monitors changes made to an object using a Proxy. So I have a function watchObject that takes an object as the argument and wraps it inside a Proxy where the ...
Seddiki Anass's user avatar
8 votes
2 answers
3k views

Proxy object cannot be added to DOM (traps doesn't trigger either)

I am trying to make a Proxy object of Image to trap properties but even with an empty handler I get an error message. TypeError: Argument 1 of Node.appendChild does not implement interface Node. ...
bjanes's user avatar
  • 263