In the Mastering Shiny book it is said that
It’s important to understand that the order your code run is solely determined by the reactive graph. This is different from most R code where the execution order is determined by the order of lines.
So why does the following Shiny app
library(shiny)
ui <- fluidPage(
)
server <- function(input, output, session) {
print(1)
print(2)
}
shinyApp(ui, server)
output to the console first 1 and then 2 ?
And why does it output these values only once, and not an infinite number of times?