auto_recalculate: Turn 'RAVE' module auto-recalculate on or off

Description Usage Arguments Details Examples

Description

Turn 'RAVE' module auto-recalculate on or off

Usage

1

Arguments

on

logical or integer; see details

Details

Used inside of 'RAVE' modules. By default modules are automatically updated: that means if an input is updated, usually the module main function will be executed and outputs will be rendered. However, if main body function takes very long time to run, automatically recalculate module will result in freeze shiny session. To solve the issue, module writers can choose manually recalculate modules by turning off auto-recalculation.

on can be logical or numerical. For logical values, either the auto-recalculation is constantly on or off. For numerical, typically integer values, on means temporary on for limited times. For example auto_recalculate(1) means run main function for one time.

To turn off auto-recalculation, call auto_recalculate within define_initialization with on=FALSE. To temporary turn on recalculation, use shiny observeEvent to capture an event and call auto_recalculate(1) once event is triggered.

Examples

1
2
3
4
5
6
7
8
9
require(shiny)
# Turn on debug mode for example
rave_context('rave_module_debug')

# In initialization
define_initialization({
  auto_recalculate(FALSE)
  # ..., other initialization code
})

dipterix/rave2 documentation built on Sept. 1, 2020, 12:07 a.m.