Function or value | Description |
Full Usage:
attempt js jsFunctionName args ofError
Parameters:
IJSRuntime
-
The JavaScript runtime, retrieved via dependency injection on a component.
jsFunctionName : string
-
The name of the JavaScript function to call.
args : obj[]
-
The arguments passed to the JavaScript function.
ofError : exn -> 'msg
-
Construct a message from an error.
Returns: Cmd<'msg>
An Elmish command that will call the JavaScript function and dispatch messages based on the result.
|
|
Full Usage:
either js jsFunctionName args ofSuccess ofError
Parameters:
IJSRuntime
-
The JavaScript runtime, retrieved via dependency injection on a component.
jsFunctionName : string
-
The name of the JavaScript function to call.
args : obj[]
-
The arguments passed to the JavaScript function.
ofSuccess : 'res -> 'msg
-
Construct a message from a successful return value.
ofError : exn -> 'msg
-
Construct a message from an error.
Returns: Cmd<'msg>
An Elmish command that will call the JavaScript function and dispatch messages based on the result.
|
Command that will perform a JavaScript interop call and map the result to a message. or error (of exception)
|
Full Usage:
perform js jsFunctionName args ofSuccess
Parameters:
IJSRuntime
-
The JavaScript runtime, retrieved via dependency injection on a component.
jsFunctionName : string
-
The name of the JavaScript function to call.
args : obj[]
-
The arguments passed to the JavaScript function.
ofSuccess : 'res -> 'msg
-
Construct a message from a successful return value.
Returns: Cmd<'msg>
An Elmish command that will call the JavaScript function and dispatch messages based on the result.
|
Command that will perform a JavaScript interop call and map the result to a message discarding any possible error.
|