#' @export
#' @rdname async_every
async_some <- function(.x, .p, ...) {
defs <- lapply(.x, async(.p), ...)
nx <- length(defs)
done <- FALSE
deferred$new(
type = "async_some", call = sys.call(),
parents = defs,
action = function(resolve) if (nx == 0) resolve(FALSE),
parent_resolve = function(value, resolve) {
if (!done && isTRUE(value)) {
done <<- TRUE
resolve(TRUE)
} else if (!done) {
nx <<- nx - 1L
if (nx == 0) resolve(FALSE)
}
}
)
}
async_some <- mark_as_async(async_some)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.