Skip to contents

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)
  • id the id used to call the module (it’s also the id of the items and linked files)

  • url the url to the item file - it’s needed to call the save function when autosave = FALSE

  • items the data frame of the items (reference of the reactiveVal)

  • data_model the data frame of the data model (reference of the reactiveVal)

  • filtered_items the data frame of the filtered items (reference of the reactiveVal)

  • selected_items a vector of item id(s) from the selected rows in the filtered view table (reference of the reactiveVal)

  • clicked_column a numeric value, indicating which column of the filtered view has been clicked (reference of the reactiveVal)

  • filter_date a numeric vector, with the value of the date slider input range (reference of the reactiveVal)

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.