Learn R Programming

shinyLottie (version 1.0.0)

lottie_destroy: Destroy a 'Lottie' Animation

Description

Permanently destroy a specific 'Lottie' animation or all 'Lottie' animations.

Usage

lottie_destroy(name = "all", session = shiny::getDefaultReactiveDomain())

Value

This function is called for a side effect, and so there is no return value.

Arguments

name

A character string specifying the name of the 'Lottie' animation to destroy. The default of "all" will destroy all animations within the 'shiny' application.

session

The 'shiny' session object. Defaults to the current reactive domain.

Details

Sends a custom session message "lottie_js_destroy" containing the function arguments.

See Also

lottie_animation_methods for similar methods.

Examples

Run this code
if (FALSE) { # interactive()
library(shiny)
library(shinyLottie)

ui <- fluidPage(
  include_lottie(),
  lottie_animation(
    path = "shinyLottie/example.json",
    name = "my_animation"
  ),
  actionButton("destroy", "Destroy Animation")
)

server <- function(input, output, session) {
  observeEvent(input$destroy, {
    lottie_destroy("my_animation")
  })
}

shinyApp(ui, server)
}

Run the code above in your browser using DataLab