Call update_tableau_settings_async() from an extension's config_server function to write settings that can be read, now and in the future, by tableau_setting().

update_tableau_settings_async(
...,
session. = shiny::getDefaultReactiveDomain()
)

## Arguments

... Settings to be persisted, as named arguments. The value should be suitable for encoding as JSON using jsonlite::toJSON(auto_unbox = TRUE). A logical (TRUE/FALSE) value. If FALSE (the default), the settings provided in ... should replace all existing settings for this extension. If TRUE, the settings provided in ... are merged with the settings that already exist. The Shiny session object. (You should probably just use the default.)

## Value

A promises::promise object. See Details.

## Details

While the settings reading functions---tableau_setting() and tableau_settings_all()---are reactive, update_tableau_settings_async() is not. Calling it does not cause any reactive dependencies to be taken.

As implied by the function name, update_tableau_settings_async() does its work asynchronously (as the actual persisting of settings must happen through the Tableau Extension API in the web browser, not directly in R). You can usually ignore this fact, except that you should ensure that if this function is being called from within an observe() or observeEvent(), that the promise object it returns is the return value of the observer code block. (This is to alert Shiny to the fact that this observer can't really be considered done with its execution until the update_tableau_settings_async() task is completely finished.)