countup_pause_resume: Pause Resume

View source: R/proxy.R

countup_pause_resumeR Documentation

Pause Resume

Description

Pause or resume the counter.

Usage

countup_pause_resume(counter)

Arguments

counter

An object of class countupProxy as returned by countupProxy().

Value

The counter

Examples

library(shiny)

ui <- fluidPage(
  countupOutput("cnt"),
  actionButton("pause/resume", "pause")
)

server <- function(input, output, session) {

  output$cnt <- renderCountup({
    countup(1000, duration = 10)
  })

  observeEvent(input$pause, {
    countupProxy("cnt") %>% 
      countup_pause_resume()
  })

}

## Not run: shinyApp(ui, server)


JohnCoene/countup documentation built on Jan. 21, 2025, 12:46 p.m.