-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Description
Calling dockViewR::get_dock() immediately after e.g. dockViewR::add_panel() appears to return an "out of date" result.
In an app as
library(shiny)
library(bslib)
library(dockViewR)
ui <- page_fillable(
dockViewOutput("dock")
)
server <- function(input, output, session) {
output$dock <- renderDockView(
dock_view(panels = list())
)
observeEvent(
get_dock("dock"),
{
add_panel("dock", panel("test1", "Test", tagList()))
message("panels: ", paste0(get_panels_ids("dock"), collapse = ", "))
},
once = TRUE
)
}
shinyApp(ui, server)I don't immediately see the added panels.
- Would passing an arg to functions like
add_panel()etc.immediate(like inshiny::insertUI()be possible/make sense? - Is there a way with current functionality to tell whether there are "outstanding" changes (i.e. things what have been modified, but are not yet reflected in the "state"?
The reason I'm asking is not a real issue, but more a theoretical concern, where the dock might be modified and then very quickly serialized/saved, with the most recent modification(s) not reflected in the saved state. In "real-world" scenarios enough time most likely will pass between these two steps.
Metadata
Metadata
Assignees
Labels
No labels