Open boxiangliu opened 6 years ago
If I understand you correctly, you'd put the if-conditional in the promise handler.
async_random <- function() {
promise_resolve(runif(1))
}
async_random() %...>% (function(val) {
if (val < 0.5)
print("less than")
else
print("greater than")
})
Suppose I want to execute something based on the result of a promise, how could I use the promise in a if-conditional? Thank you!