![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <WebJSFunction.h>
Inheritance diagram for FWebJSResponse:Public Member Functions | |
| FWebJSResponse () | |
| FWebJSResponse (TSharedPtr< FWebJSScripting > InScripting, const FGuid &InCallbackId) | |
| void | Success () const |
| template<typename T > | |
| void | Success (T Arg) const |
| template<typename T > | |
| void | Failure (T Arg) const |
Public Member Functions inherited from FWebJSCallbackBase | |
| FWebJSCallbackBase () | |
| bool | IsValid () const |
Additional Inherited Members | |
Protected Member Functions inherited from FWebJSCallbackBase | |
| FWebJSCallbackBase (TSharedPtr< FWebJSScripting > InScripting, const FGuid &InCallbackId) | |
| WEBBROWSER_API void | Invoke (int32 ArgCount, FWebJSParam Arguments[], bool bIsError=false) const |
Representation of a remote JS async response object. UFUNCTIONs taking a FWebJSResponse will get it passed in automatically when called from a web browser. Pass a result or error back by invoking Success or Failure on the object. UFunctions accepting a FWebJSResponse should have a void return type, as any value returned from the function will be ignored. Calling the response methods does not have to happen before returning from the function, which means you can use this to implement asynchronous functionality.
Note that the remote object will become invalid as soon as a result has been delivered, so you can only call either Success or Failure once.
|
inline |
|
inline |
Indicate failed completion, passing an error message back to JS. The remote Promise's catch() handler will be executed with the value passed as the error reason.
|
inline |
Indicate successful completion without a return value. The remote Promise's then() handler will be executed without arguments.
Indicate successful completion passing a return value back. The remote Promise's then() handler will be executed with the value passed as its single argument.