Learn R Programming

rewind (version 0.3.0)

rewind_undo: Move through the history programmatically

Description

The keyboard shortcuts and rewind_buttons() are sufficient for most applications. Use these functions to move through the history from your own controls.

Usage

rewind_undo(session = shiny::getDefaultReactiveDomain())

rewind_redo(session = shiny::getDefaultReactiveDomain())

rewind_jump(index, session = shiny::getDefaultReactiveDomain())

rewind_clear(session = shiny::getDefaultReactiveDomain())

Value

TRUE if the position changed. If not, FALSE. The functions return the value invisibly.

Arguments

session

The Shiny session. The default is the current session.

index

The position to move to. The first position is 1. Position 1 holds the oldest entry that rewind keeps.

Examples

Run this code
if (interactive()) {
  library(shiny)

  server <- function(input, output, session) {
    rewind_enable()
    observeEvent(input$my_back_button, rewind_undo())
  }
}

Run the code above in your browser using DataLab