-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to trigger method overridden in js from c? #28
Comments
I think the only way to achieve this is to replace |
Thanks Sam. It's what I was expecting might be the case. The object myClass is created in javascript. Do you know how I can get the JSValue for myClass from the C++ side? I'd like to make this friendly for the user, so avoiding messy solutions like the user passing it back from javascript to c++ via a method call. On the C++ side I would like to do something like:
|
I'm actually struggling with that same problem just for objects that have been instantiated in JS. EG:
In C++, MyThing::doSomething wants to call the onUpdate method:
the not set codepath is being taken unless the onUpdate method was defined in c++ too. likely a wrong Previously with dukglue I was able to do |
Currently testing this feature in |
Example:
I would like this to happen:
I suspect that inside ExampleClass::exampleMethod (and every method where I want this behaviour) I need to check whether the instance has a JS object associated and then manually call exampleMethod on that JS object?
But I'm hoping there is an easier way?
The text was updated successfully, but these errors were encountered: