Last active
November 25, 2021 13:32
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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