collect() on a tbl_lazy_json returns a promises::promise(), because the
result is fetched asynchronously from the browser. These operators from the
promises package are re-exported so you can consume that result inside
shiny::observeEvent() / shiny::observe() without attaching promises
yourself.
Arguments
- lhs
A promise (e.g. the value returned by
collect()).- rhs
A function call or expression applied to the resolved value.
Examples
if (FALSE) { # \dontrun{
shiny::observeEvent(input$compute, {
lazy_data() |>
dplyr::filter(mpg >= input$min_mpg) |>
dplyr::collect() %...>% {
# `.` is the collected tibble
print(.)
}
})
} # }
