rstudio/shiny

documentation tweak for `onStart` argument in `shinyApp` help page

tyner opened this issue · 1 comments

In the help page for shinyApp it says

 onStart: A function that will be called before the app is actually
          run. This is only needed for ‘shinyAppObj’, since in the
          ‘shinyAppDir’ case, a ‘global.R’ file can be used for this
          purpose.

I suspect that where it says ‘shinyAppObj’ it should actually be ‘shinyApp’ ?

I think you are right.

The ‘shinyAppObj’ case refers to the possibility of defining a shiny app without using a file based app format (No app.R or ui.R and server.R files) via shinyApp().

Something like:

library(shiny)

myShinyAppObj <- shinyApp(ui = fluidPage(), server = function(input, output, session) {})
is(myShinyAppObj)
runApp(myShinyAppObj)

The file based formats are handled by shinyAppDir() or shinyAppFile() which don't provide an onStart argument. However, they still result in a shiny.appobj.