Module Server Return Value
Introduction
The module server returns a list of the references that are accessible outside the module.
# -- Module server return value
list(id,
url,
items,
data_model,
filtered_items,
selected_items,
clicked_column,
filter_date)idthe id used to call the module (it’s also the id of the items and linked files)urlthe url to the item file - it’s needed to call the save function whenautosave = FALSEitemsthe data frame of the items (reference of thereactiveVal)data_modelthe data frame of the data model (reference of thereactiveVal)filtered_itemsthe data frame of the filtered items (reference of thereactiveVal)selected_itemsa vector of itemid(s) from the selected rows in the filtered view table (reference of thereactiveVal)clicked_columna numeric value, indicating which column of the filtered view has been clicked (reference of thereactiveVal)filter_datea numeric vector, with the value of the date slider input range (reference of thereactiveVal)
All except id & url are references to reactive values that needs to be accessed in a reactive context.
Considerations
The magic with passing references is that the value itself is not copied or duplicated.1
The data model or items are not copied to the output, and it’s possible to access them from the outside of the module.
This communication strategy has been chosen over other method like passing a reactiveValues object as argument to the module that will ‘feed’ it because it makes code less readable and more complex to implement.
It also allows to use the exported functions of the package from outside of the module server, which provides more flexible implementation options.