Open wch opened 8 months ago
Update: this may not be necessary because we already have:
@expressify
@display_body
And soon we will have modules that work with Express syntax.
Hello,
I would like to follow up on @wch comment about modules for Express syntax. I can see there is a module decorator now for Express, but I doesn't seem to be able to return anything. I would like to use it to update a reactive variable in the main app I can then use. Am I missing something, or is the module syntax not complete yet?
Thanks!
Summary: It could be useful to have something like
@expressify()
, but for imports instead of functions.A user might want to break a Shiny Express app into multiple files, so the
app.py
looks something like this:Where
section1.py
andsection2.py
contain Shiny Express code.However, this won't work because the
import
won't evaluatesection1
orsection2
as Express, displaying contents as it goes.To allow this, we could export the
run_express
function. It would also require a few modifications so that it doesn't try to alter any top-level state. The code would then look like this:It may be possible for it to return the values from running the code, so that you could do: