Learn R Programming

shinyTimer (version 0.1.0)

pauseTimer: Pause shinyTimer

Description

Pause shinyTimer

Usage

pauseTimer(inputId, session = shiny::getDefaultReactiveDomain())

Value

No return value, called for side effects.

Arguments

inputId

The input ID corresponding to the UI element.

session

The session object from the shiny server function.

Examples

Run this code
if (interactive()) {
  library(shiny)
  shinyApp(
    ui = fluidPage(
      shinyTimer("timer", label = "Countdown Timer", seconds = 20, type = "mm:ss"),
      actionButton("start", "Start Countdown"),
      actionButton("pause", "Pause Countdown")
    ),
    server = function(input, output, session) {
      observeEvent(input$start, {
        countDown("timer")
      })
      observeEvent(input$pause, {
        pauseTimer("timer")
      })
    }
  )
}

Run the code above in your browser using DataLab