Details
-
Suggestion
-
Resolution: Out of scope
-
Not Evaluated
-
None
-
None
-
None
Description
The subclass or QJSValue itself could have signals or any other API you deem suitable to handle promise resolution and rejection.
The use case is calling Javascript functions that return promises from C++.
This is what usage could look like:
QJSValue promise = myJsFunction.call(myArgs); connect(&promise, QJSValue::then, this, [](QJSValue data) { // do something }); connect(&promise, QJSValue::catch, this, [](QJSValue error) { // do something });