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.
Right, I should have asked more precisely - how should one think of the order of non-reactive shiny server commands ? Are they run in sequence? Only once?
P.s. Now updated in the title and added "non-reactive"
yes, they run in sequence like an r script, the server code is run line by line.
any reactive code in there can contribute to setting up the reactive graph, and non reactive code just runs when its encountered.
However, in a module, if the last statement is a return statement, it does not get executed immediately, in the sense that the module does not finish the execution when the return statement is evaluated.
Why?