Utility functions for shiny:
get_session: Seeshiny::getDefaultReactiveDomain().generate_plugin_args: Meant for unit testing plugins.notify: Glue-capable wrapper forshiny::showNotification().
Usage
get_session()
generate_plugin_args(board, ..., mode = c("edit", "read"))
notify(
...,
envir = parent.frame(),
action = NULL,
duration = 5,
close_button = TRUE,
id = NULL,
type = c("message", "warning", "error"),
session = get_session()
)Arguments
- board
A board object
- ...
Concatenated as
paste0(..., "\n")- mode
Edit plugins, such as
manage_blocksget an additional argumentupdateover read plugins such aspreserve_board.- envir
Environment where the logging call originated from
- action
Message content that represents an action. For example, this could be a link that the user can click on. This is separate from
uiso customized layouts can handle the main notification content separately from action content.- duration
Number of seconds to display the message before it disappears. Use
NULLto make the message not automatically disappear.Passed as
closeButtontoshiny::showNotification()- id
A unique identifier for the notification.
idis optional forshowNotification(): 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.idis required forremoveNotification().- type
A string which controls the color of the notification. One of "default" (gray), "message" (blue), "warning" (yellow), or "error" (red).
- session
Session object to send notification to.