R/util.R

#' Add necessary js components for shinyStorage
#'
#' \code{addSS}
#' A utility function to add the simpleStorage javascript library to a shiny app.
#' @import shiny
#' @export
#' @examples
#' \dontrun{
#' shinyUI({
#' fluidPage(
#'   addSS()
#' )
#' })
#' }

addSS <- function() {
  addResourcePath(
    prefix = 'shinystorage',
    directoryPath = system.file('www', package='shinyStorage')
  )
  singleton(tags$head(
    tags$script(src = 'shinystorage/simpleStorage.js')
    , tags$script(src = 'shinystorage/ssInit.js')
  ))
}
johndharrison/shinyStorage documentation built on May 19, 2019, 5:13 p.m.