Header menu logo Sutil

OfPromise Module

Functions and values

Function or value Description

attempt task arg ofError

Full Usage: attempt task arg ofError

Parameters:
    task : 'a -> Promise<unit>
    arg : 'a
    ofError : 'a0 -> 'msg

Returns: Cmd<'msg>

Command to call `promise` block and map the error

task : 'a -> Promise<unit>
arg : 'a
ofError : 'a0 -> 'msg
Returns: Cmd<'msg>

either task arg ofSuccess ofError

Full Usage: either task arg ofSuccess ofError

Parameters:
    task : 'a -> Promise<'a0>
    arg : 'a
    ofSuccess : 'a0 -> 'msg
    ofError : 'b -> 'msg

Returns: Cmd<'msg>

Command to call `promise` block and map the results

task : 'a -> Promise<'a0>
arg : 'a
ofSuccess : 'a0 -> 'msg
ofError : 'b -> 'msg
Returns: Cmd<'msg>

perform task arg ofSuccess

Full Usage: perform task arg ofSuccess

Parameters:
    task : 'a -> Promise<'a0>
    arg : 'a
    ofSuccess : 'a0 -> 'msg

Returns: (('msg -> 'b) -> unit) list

Command to call `promise` block and map the success

task : 'a -> Promise<'a0>
arg : 'a
ofSuccess : 'a0 -> 'msg
Returns: (('msg -> 'b) -> unit) list

result task

Full Usage: result task

Parameters:
Returns: (('msg -> 'a) -> unit) list

Command to dispatch the `promise` result

task : Promise<'msg>
Returns: (('msg -> 'a) -> unit) list

Type something to start searching.