Constructs a Future holding a successful 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 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;
}