rx_debounce: Debounce a reactive expression

Description Usage Arguments Details

View source: R/higherorder.R

Description

Transforms a reactive expression by preventing its invalidation signals from being sent until activity has stopped for the given number of milliseconds. This lets you ignore a very "chatty" reactive expression until it becomes idle, which is useful when the intermediate values don't matter as much as the final value, and the downstream calculations that depend on the reactive expression take a long time.

Usage

1
rx_debounce(rxexpr, millis, domain = shiny::getDefaultReactiveDomain())

Arguments

rxexpr

A reactive expression that invalidates too often.

millis

Number of milliseconds of inactivity to wait for before allowing invalidation to succeed.

domain

See domains.

Details

This is not a true debounce in that it will not prevent expr from being called many times (in fact it may be called more times than usual), but rather, the reactive invalidation signal that is produced by expr is debounced instead. This means that rx_debounce should be used when expr is cheap but the things it will trigger (outputs and reactives that use expr) are expensive.


jcheng5/rxtools documentation built on May 18, 2019, 10:22 p.m.