pin_reactive_read: Wrap a pin in a reactive expression

Description Usage Arguments Examples

View source: R/pin_reactive.R

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

1
2
3
pin_reactive_read(board, name, interval = 5000)

pin_reactive_download(board, name, interval = 5000)

Arguments

board

A pin board, created by board_folder(), board_rsconnect(), board_url() or other other 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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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. 2, 2021, 5:06 p.m.