Skip to contents

Append code skeleton with shinybreakpoint functionality to the active (opened) file in RStudio.

Usage

snippet()

Value

Appends code skeleton to the file.

Details

shinybreakpoint needs server logic to be included in the function separated from the server part of app, was also developed having Bootstrap version 5 in mind and some functionalities needs shiny::reactlog enabled as well as managing temporary files (shinybreakpoint::set_filtering_by_id()) is responsible for this. This snippet takes care of all of that.

Snippet is also available as the addin, under the name snippet.

Examples


if (FALSE) {
# use shinybreakpoint::snippet() in the Console in RStudio
# (or find `snippet` addin in Addins menu)
# if there is an opened file (in Source Editor),
# then this skeleton should be added to the file:
library(shiny)

shinybreakpoint::set_filtering_by_id() # TODO: remove

ui <- fluidPage(
  theme = bslib::bs_theme(5),

)

appServer <- function(input, output, session) {

}

server <- function(input, output, session) {
  shinybreakpoint::shinybreakpointServer() # TODO: remove
  appServer(input, output, session)
}

shinyApp(ui, server)
}