pin_reactive_read: Wrap a pin in a reactive expression

View source: R/pin_reactive.R

pin_reactive_readR Documentation

Wrap a pin in a reactive expression

Description

pin_reactive_read() and pin_reactive_download() wrap the results of pin_read() and pin_download() into a Shiny reactive. This allows you to use pinned data within your app, and have the results automatically recompute when the pin is modified.

Usage

pin_reactive_read(board, name, interval = 5000)

pin_reactive_download(board, name, interval = 5000)

Arguments

board

A pin board, created by board_folder(), board_connect(), board_url() or another board_ function.

name

Pin name.

interval

Approximate number of milliseconds to wait between re-downloading the pin metadata to check if anything has changed.

Examples

if (FALSE) {
  library(shiny)
  ui <- fluidPage(
    tableOutput("table")
  )

  server <- function(input, output, session) {
    board <- board_local()
    data <- pin_reactive_read(board, "shiny", interval = 1000)
    output$table <- renderTable(data())
  }
  shinyApp(ui, server)
}

pins documentation built on Oct. 7, 2024, 5:07 p.m.