Constructs a future holding a failure value.
Constructs a future holding a failure value.
const { rejected } = require('folktale/concurrency/future');
rejected(1).mapRejected(x => {
$ASSERT(x == 1);
});
rejected(reason) {
let result = new Future(); // eslint-disable-line prefer-const
result._state = Rejected(reason);
return result;
}