0

I'm writing a Shiny module that could be used in multiple places, so the function that calls the server part has lots of arguments. I'm debating internally whether some arguments should be "fixed", you set them up when calling the module and that's that, or if as many as possible should be reactive, so that inputs in other parts of the app can modify how the module behaves on the fly.

Is there any reason not to make all arguments reactive? And then, even if I decide they won't ever be modified once the app starts, I'll just specify the arguments like reactive(constant_value). Will the app work slower if I feed modules reactives?

The values that arguments take generally aren't large, at most 1 dataframe and a few length 1 or length 2 vectors.

This isn't a question about a specific implementation, but about what constitutes good practice. I haven't seen much discussion about this regarding Shiny apps.

mkranj
  • 144
  • 8

0 Answers0