Once you create data pipelines, you can consider reusing the resources they produce in Shiny or Plumber applications. This can be useful to componentize your application and avoid redeploying or restarting your application.

When using Plumber, you can simply use pin_get() since this function is smart-enough to first check for updates before the resource is retrieved When using Shiny, you can use pin_reactive() which automatically transforms the pin’s resource into a reactive to use from your application.

We can improve the pipeline from the Create Data Pipelines use-case by properly generating a web application to display the auto-generated news.

A Shiny application that reuses the news-generated pin looks as follows:

library(shiny)
library(dplyr)
library(pins)

board_register("rsconnect", server = "https://beta.rstudioconnect.com")

ui <- fluidPage(
tags$head(tags$style(HTML("pre { white-space: pre-wrap; }"))),
fluidPage(
fluidRow(
),
fluidRow(verbatimTextOutput("newsContent"))
)
)

server <- function(input, output, session) {
news <- pin_reactive("news-generated", board = "rsconnect")

observe({
choices <- pull(news(), title)
updateSelectInput(session = session, inputId = "newsHeadline", choices = choices, selected = choices[1])
})

output$newsContent <- renderText ({ filter(news(), title == input$newsHeadline) %>%
pull(generated) %>%