W3cubDocs

/Pony

_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

© 2016-2018, The Pony Developers
© 2014-2015, Causality Ltd.
Licensed under the BSD 2-Clause License.
https://stdlib.ponylang.io/promises-_Then