OfJS Module

Functions and values

Function or value Description

attempt js jsFunctionName args ofError

Full Usage: attempt js jsFunctionName args ofError

Parameters:
    js : 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.

Command that will perform a JavaScript interop call and map the error (of exception).

js : 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.

either js jsFunctionName args ofSuccess ofError

Full Usage: either js jsFunctionName args ofSuccess ofError

Parameters:
    js : 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)

js : 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.

perform js jsFunctionName args ofSuccess

Full Usage: perform js jsFunctionName args ofSuccess

Parameters:
    js : 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.

js : 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.