# Waits x seconds, then returns x*10
wait_this_long <- function(x) {
promise(\(resolve, reject) {
later::later(\() resolve(x*10), delay = x)
})
}
promise_map(
list(A=1, B=2, C=3),
wait_this_long
) |>
then(print)
Run the code above in your browser using DataLab