Utility functions for shiny:
get_session: See shiny::getDefaultReactiveDomain().
generate_plugin_args: Meant for unit testing plugins.
notify: Glue-capable wrapper for shiny::showNotification().
get_session()notify(
...,
envir = parent.frame(),
action = NULL,
duration = 5,
close_button = TRUE,
id = NULL,
type = c("message", "warning", "error"),
session = get_session()
)
Either NULL or a shiny session object for get_session(), a list
of arguments for plugin server functions in the case of
generate_plugin_args() and notify() is called for the side-effect of
displaying a browser notification (and returns NULL invisibly).
Concatenated as paste0(..., "\n")
Environment where the logging call originated from
Message content that represents an action. For example, this
could be a link that the user can click on. This is separate from ui
so customized layouts can handle the main notification content separately
from action content.
Number of seconds to display the message before it
disappears. Use NULL to make the message not automatically
disappear.
Passed as closeButton to shiny::showNotification()
A unique identifier for the notification.
id is optional for showNotification(): Shiny will automatically create
one if needed. If you do supply it, Shiny will update an existing
notification if it exists, otherwise it will create a new one.
id is required for removeNotification().
A string which controls the color of the notification. One of "default" (gray), "message" (blue), "warning" (yellow), or "error" (red).
Session object to send notification to.