Details
-
Type:
Suggestion
-
Status: Closed
-
Priority:
Not Evaluated
-
Resolution: Out of scope
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: QML: Declarative and Javascript Engine
-
Labels: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 });