express.expressify

express.expressify(fn=None, *, has_docstring=False)

Decorate a function so that output is captured as in Shiny Express

In a Shiny Express app, the output of each line of the app file is captured and displayed in the UI. However, if the app calls a function, only the return value of the function is displayed. This decorator changes the behavior of the function so that when it is executed, the result of each line is captured and displayed, just like code at the top level of a Shiny Express app.

Parameters

fn: TFunc | None = None

The function to decorate. If not provided, this is a decorator factory.

has_docstring: bool = False

Whether the function has a docstring. Set this to True if the function to decorate has a docstring. This tells expressify() to not capture the docstring and display it in the UI.

Returns

Type Description
TFunc | Callable[[TFunc], TFunc] A function that returns None, or a decorator for a function that returns None.

See Also