Skip to content

Instantly share code, notes, and snippets.

@ijlyttle
Created July 25, 2014 17:39
Show Gist options
  • Select an option

  • Save ijlyttle/97ea3b97195d330ed362 to your computer and use it in GitHub Desktop.

Select an option

Save ijlyttle/97ea3b97195d330ed362 to your computer and use it in GitHub Desktop.
idea to keep status on if data are ready in shiny
library(shiny)
shinyApp(
ui = wellPanel(
actionButton(
"file",
label = "file upload"
),
actionButton(
"update",
label = "update"
)
),
server = function(input, output, session){
observe(print(paste0("file : ", input$file[[1]])))
observe(print(paste0("update : ", input$update[[1]])))
observe(print(paste0("file_at_last_update : ", rct_file_at_last_update())))
observe(print(paste0("is_ready : ", rct_is_ready())))
rct_file_at_last_update <- reactive({
input$update
isolate(input$file)
})
rct_is_ready <- reactive({
is_ready <-
input$file > 0 &
input$file == rct_file_at_last_update()
is_ready
})
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment