Open olehmisar opened 5 years ago
You can use Symbol
class to make unique value
Possibly related projects:
https://github.com/morko/haxroomie-EventTrapper https://github.com/saviola777/haxball-headless-manager
These projects use JavaScript Proxies to intercept / delegate calls.
@saviola777 Proxies is a bad choice because they are very slow. I just need to get list of all callbacks to register them.
Hey, basro. I am currently making haxball API wrapper for better development. I use custom class which contains
_room
property that references original RoomObject. To delegate methods I use something like this:This code delegates methods like
setPlayerAdmin
orsetPlayerTeam
.I also need to delegate callbacks. But it is impossible now because callbacks don't exist on RoomObject by default.
I am asking you to add default callbacks on RoomObject. It can be
null
orsome_unique_value
if you don't want it to be a function. So, I will be able to delegate callbacks too: