Skip to content

_Then[A: Any #share, B: Any #share]

[Source]

A step in a promise pipeline.

class ref _Then[A: Any #share, B: Any #share]

Constructors

create

[Source]

A step is represented by a fulfill function and a reject function.

new iso create(
  fulfill: Fulfill[A, B] iso,
  rejected: Reject[B] iso)
: _Then[A, B] iso^

Parameters

Returns


Public Functions

promise

[Source]

Returns the next promise in the chain.

fun box promise()
: Promise[B] tag

Returns


apply

[Source]

Called with the result of the previous promise when it is fulfilled.

fun ref apply(
  value: A)
: None val

Parameters

  • value: A

Returns


reject

[Source]

Called when the previous promise is rejected.

fun ref reject()
: None val

Returns