rejected

Constructs a future holding a failure value.

Signature

rejected(reason)
forall a, b: (Future).(a) => Future a b

Documentation

Constructs a future holding a failure value.

Example:

const { rejected } = require('folktale/concurrency/future');

rejected(1).mapRejected(x => {
  $ASSERT(x == 1);
});

Properties

Source Code

Defined in source/concurrency/future/_future.js at line 253, column 22
rejected(reason) {
    let result = new Future();      // eslint-disable-line prefer-const
    result._state = Rejected(reason);
    return result;
  }
Stability
stable
Licence
MIT
Module
folktale/concurrency/future/_future
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)