snippet: Write (Append) Basic Shiny App With Shinybreakpoint...

View source: R/snippet.R

snippetR Documentation

Write (Append) Basic Shiny App With Shinybreakpoint Functionality

Description

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

Usage

snippet()

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.

Value

Appends code skeleton to the file.

Examples


## Not run: 
# 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)

## End(Not run)

gsmolinski/shinybreakpoint documentation built on Jan. 13, 2023, 12:48 a.m.