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)) +```