From 8fcb7bedb484974f40e3626a64fdde0924c14f63 Mon Sep 17 00:00:00 2001 From: Craig Williams Date: Mon, 26 Jan 2026 11:39:16 +0000 Subject: [PATCH] Added readme, renamed file for bannerDisconnectHandler --- .Rbuildignore | 1 + ...Handler.R => useBannerDisconnectHandler.R} | 0 README.Rmd | 44 +++++++++++++++++++ README.md | 35 +++++++++++++++ 4 files changed, 80 insertions(+) rename R/{PrettyShinyDisconnectHandler.R => useBannerDisconnectHandler.R} (100%) create mode 100644 README.Rmd create mode 100644 README.md diff --git a/.Rbuildignore b/.Rbuildignore index 5163d0b..2a2cb83 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1 +1,2 @@ ^LICENSE\.md$ +^README\.Rmd$ diff --git a/R/PrettyShinyDisconnectHandler.R b/R/useBannerDisconnectHandler.R similarity index 100% rename from R/PrettyShinyDisconnectHandler.R rename to R/useBannerDisconnectHandler.R diff --git a/README.Rmd b/README.Rmd new file mode 100644 index 0000000..522219a --- /dev/null +++ b/README.Rmd @@ -0,0 +1,44 @@ +--- +output: github_document +--- + + + +```{r, include = FALSE} +knitr::opts_chunk$set( + collapse = TRUE, + comment = "#>", + fig.path = "man/figures/README-", + out.width = "100%" +) +``` + +# AVSDevR.ShinyDisconnectHandler + + + + +The goal of AVSDevR.ShinyDisconnectHandler is to provide alternatives to the Shiny default disconnect handler which nicer styling, refresh options and user interaction. + +## Installation + +You can install the development version of AVSDevR.ShinyDisconnectHandler like so: + +``` r +remotes::install_git("https://git.avsdev.uk/R/AVSDevR.ShinyDisconnectHandler") +``` + +## Example + +To use a disconnect banner instead of the default disconnect handler: + +```{r banner_example, eval = FALSE} +library(AVSDevR.ShinyDisconnectHandler) +ui <- shiny::fluidPage( + useBannerDisconnectHandler() +) +server <- function(...) { + stop("This stops the server, disconnecting the client") +} +shiny::runApp(shiny::shinyApp(ui, server)) +``` diff --git a/README.md b/README.md new file mode 100644 index 0000000..0d7ef5d --- /dev/null +++ b/README.md @@ -0,0 +1,35 @@ + + + +# AVSDevR.ShinyDisconnectHandler + + + + +The goal of AVSDevR.ShinyDisconnectHandler is to provide alternatives to +the Shiny default disconnect handler which nicer styling, refresh +options and user interaction. + +## Installation + +You can install the development version of +AVSDevR.ShinyDisconnectHandler like so: + +``` r +remotes::install_git("https://git.avsdev.uk/R/AVSDevR.ShinyDisconnectHandler") +``` + +## Example + +To use a disconnect banner instead of the default disconnect handler: + +``` r +library(AVSDevR.ShinyDisconnectHandler) +ui <- shiny::fluidPage( + useBannerDisconnectHandler() +) +server <- function(...) { + stop("This stops the server, disconnecting the client") +} +shiny::runApp(shiny::shinyApp(ui, server)) +```