Skip to contents

How to set up an eDISH module using dispatchers

Dispatchers are helper functions that allow accessing data and utility functions inside module manager in a dynamic way. Refer to ?dv.manager::mm_dispatch for more information about their functionalities. Below, you can find two examples on how they can be used to set up an eDISH module. Note that it is not possible to use both arguments, dataset_names and dataset_disp, at the same time in a mod_edish() call.

a. Filtered data

This code piece produces essentially the same app behavior as using the dataset_names argument. That is, any selection made by the user in the global filter menu affects the module display.

mod_edish(
  module_id = "edish_a",
  dataset_disp = dv.manager::mm_dispatch(
    from = "filtered_dataset",
    selection = c("dm", "lb")
  )
)

b. Unfiltered data

In case it is undesirable that global filter settings affect the listings displayed in the eDISH module, it is possible to define the dispatcher such that it delivers always unfiltered data. This means that any global filter will be ignored!

mod_edish(
  module_id = "edish_b",
  dataset_disp = dv.manager::mm_dispatch(
    from = "unfiltered_dataset",
    selection = c("dm", "lb")
  )
)