Learn R Programming

rewind (version 0.4.0)

rewind_status: See what rewind captures, and why it leaves an input out

Description

An undo that skips an input is hard to explain from outside. The input can be excluded, can be a password field, can be missing from inputs, or can be one that the page cannot put back. This function lists every input of the session with the reason, so one call answers the question.

Usage

rewind_status(session = shiny::getDefaultReactiveDomain())

Value

A list:

  • captured: the names of the inputs that rewind records.

  • skipped: a named character vector. Each name is an input, and each value is the reason it is not recorded: "excluded", "password field", "not in inputs", "cannot be restored by the page", "action button", "file upload" or "NULL value". Inputs internal to Shiny and to rewind are left out of the list.

  • tracked: the groups registered with rewind_track(), each with the fields it names (NULL for all fields).

  • restorable: the inputs that the page reported it can restore, or NULL before the report arrives. Refer to rewind_enable().

  • paused: TRUE between rewind_pause() and rewind_resume().

  • size, position: the number of steps, and the current one.

Arguments

session

The Shiny session. The default is the current session.

Details

It reads every input, so inside render*() the result follows the inputs and the history. That makes it useful in a debug panel, for example renderPrint(rewind_status()).

Examples

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

  ui <- fluidPage(
    rewind_buttons(),
    selectInput("region", "Region", c("North", "South")),
    passwordInput("pw", "Password"),
    verbatimTextOutput("status")
  )

  server <- function(input, output, session) {
    rewind_enable()
    output$status <- renderPrint(rewind_status()$skipped)
  }

  shinyApp(ui, server)
}

Run the code above in your browser using DataLab