I'm deploying my app to shinyapps and I'm noticing some strange behaviour when I have multiple windows open. I have rendered a datatable and when I update the filters on a window, my table only updates on the last window that was opened.
I have moved my reactive values to be loaded in the server function after reading the scoping documentation.
app.R
source("helpers/load_data.R")
server <- function(input, output, session) {
source("helpers/load_session_data.R")
observeEvent(input$get_filtered_data, {
# UpdateTable function takes my table_csv and filters by the date, and updates the riskData reactive value
UpdateTable(table, input$date)
}
UpdateTable <- function(table, date) {
#... filter stuff
riskData$data <- filtered_table
}
}
load_session_data.R
#table is a data.frame loaded globally outside of the ui and server functions.
riskData <- reactiveValues(data = table_csv)
I thought that loading my reactive values in the server function meant that each session would have it's own reactive values? I want to be able to filter a table independently in different sessions.