You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
teal::init to return "teal_app" object (simple S3 class). For this class we can have a print method which can look as follows:
print.teal_app <- function(x, ...) {
cat("teal app <more information about the app>")
shiny::shinyApp(x$ui, x$srv)
}
Thanks to above "teal_app" object will preserve previous features (list of ui, server, ui_args, ... etc) and could be run without shinyApp(x$ui, x$server) . This would shorten the apps code:
# from
app <- teal::init(...)
shinyApp(app$ui, app$server)
# to
teal::init(...)
With the S3 class first and the second in above code would be possible.
Alternatively, print.teal_app could just print information about the app with note use shinyApp(x$ui, x$server) to run the app.
gogonzo
changed the title
[Feature Request]: teal::init output to have a print method
[Feature Request]: teal::init to return shinyApp instead of list
Oct 27, 2023
gogonzo
changed the title
[Feature Request]: teal::init to return shinyApp instead of list
[Feature Request]: teal::init to return shinyApp instead of a list
Oct 27, 2023
teal::init
to return"teal_app"
object (simple S3 class). For this class we can have a print method which can look as follows:Thanks to above "teal_app" object will preserve previous features (list of ui, server, ui_args, ... etc) and could be run without shinyApp(x$ui, x$server) . This would shorten the apps code:
With the S3 class first and the second in above code would be possible.
Alternatively, print.teal_app could just print information about the app with note use shinyApp(x$ui, x$server) to run the app.
Please note that shiny works in very similar way
https://github.com/rstudio/shiny/blob/370ba1f288d3f759456ef3ef6e768ee1d7fda677/R/shinyapp.R#L552
The text was updated successfully, but these errors were encountered: