Constructs a Future holding a successful value.
Constructs a Future holding a successful value.
const { of } = require('folktale/concurrency/future');
of(1).map(x => {
$ASSERT(x == 1);
});
of(value) {
let result = new Future(); // eslint-disable-line prefer-const
result._state = Resolved(value);
return result;
}