shinyanimate
shinyanimate copied to clipboard
Session
Removed the need to pass session to the animate functions :)
This way you can simply use it like so:
library(shiny)
library(shinyanimate)
ui <- fluidPage(
withAnim(),
div( id = 'shinyLogo', tags$img(src= "https://www.rstudio.com/wp-content/uploads/2014/04/shiny-600x695.png", width = "100px", height = "100px")),
actionButton(inputId = "button", label = "Animate")
)
server <- function(input, output, session) {
observeEvent(input$button,{
startAnim('shinyLogo', 'shake') # no session
})
}
shinyApp(ui, server)
Removed the need to pass session to the animate functions :)
This way you can simply use it like so:
library(shiny) library(shinyanimate) ui <- fluidPage( withAnim(), div( id = 'shinyLogo', tags$img(src= "https://www.rstudio.com/wp-content/uploads/2014/04/shiny-600x695.png", width = "100px", height = "100px")), actionButton(inputId = "button", label = "Animate") ) server <- function(input, output, session) { observeEvent(input$button,{ startAnim('shinyLogo', 'shake') # no session }) } shinyApp(ui, server)
@JohnCoene It is good that we do not have to pass session anymore but with this change it won't be backward compatible and this would be a breaking change. So I'll keep this PR on hold for the moment until we do not add more features so that breaking changes would be acceptable.
Sure your call :)