Package com.vaadin.client.flow.util
Class NativeFunction
java.lang.Object
com.vaadin.client.flow.util.NativeFunction
@JsType(isNative=true,
name="Function",
namespace="<global>")
public class NativeFunction
extends Object
JsInterop wrapper for interacting with the JavaScript Function type.
- Since:
- 1.0
- Author:
- Vaadin Ltd
-
Constructor Summary
ConstructorsConstructorDescriptionNativeFunction(String... paramsAndCode) Creates a new function with the given parameters and implementation. -
Method Summary
Modifier and TypeMethodDescriptionInvokes this function with a giventhisand arguments provided as an array.Invokes this function with a giventhisand arguments provides as varargs.static <T> TCreates a new function with the given parameters and implementation.
-
Constructor Details
-
NativeFunction
Creates a new function with the given parameters and implementation.- Parameters:
paramsAndCode- parameter names followed by the code of the function
-
-
Method Details
-
apply
Invokes this function with a giventhisand arguments provided as an array.- Parameters:
thisArg- the value ofthisarguments- an array of arguments- Returns:
- the return value of the invocation
-
call
Invokes this function with a giventhisand arguments provides as varargs.- Parameters:
thisArg- the value ofthisarguments- the arguments to invoke this function with- Returns:
- the return value of the invocation
-
create
Creates a new function with the given parameters and implementation. The return value of this method is intended to be used as a type annotated with@JsFunction.- Type Parameters:
T- the function type- Parameters:
paramsAndCode- parameter names followed by the code of the function- Returns:
- the native function
-