Skip to content

Instantly share code, notes, and snippets.

@PaulC91
Last active November 25, 2021 13:32
Show Gist options
  • Save PaulC91/ff106f830282845e3abe16d43152bfa5 to your computer and use it in GitHub Desktop.
Save PaulC91/ff106f830282845e3abe16d43152bfa5 to your computer and use it in GitHub Desktop.
Example of code to only launch a shiny module when its tab is selected for the first time
tab2_init <- TRUE
observeEvent(input$tabs, { # input$tabs is the menu input
if (all(input$tabs == "tab2", tab2_init)) {
# change to false so it won't run again
tab2_init <<- FALSE
# call server module
tab2Server("id", ...)
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment