Constructs a future holding a failure value.
This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.
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;
}