R/hideToast.R

Defines functions hideToast

Documented in hideToast

#' Hide existing toast messages
#'
#' @param animate a logical indicating whether to remove the toast message(s) instantly or use its \code{hideMethod} with animations to remove (Default).
#' @param session the Shiny session. Defaults to \code{shiny::getDefaultReactiveDomain()}.
#'
#' @export
#'
#' @importFrom shiny getDefaultReactiveDomain
#'
#' @return `invisible()`
#'
hideToast <- function(
  animate = TRUE,
  session = shiny::getDefaultReactiveDomain()
) {
  
  session$sendCustomMessage(
    type = "hide_toastr",
    message = list(
      'animate' = animate
    )
  )
  
  invisible()
}

Try the shinyFeedback package in your browser

Any scripts or data that you put into this service are public.

shinyFeedback documentation built on Sept. 24, 2021, 5:07 p.m.