rx_calc_with_previous: Reactive calculation with previous value

Description Usage Arguments Value

View source: R/misc.R

Description

Use this variant of rx_calc when your logic depends on the previous value you generated. For example, you might want to accumulate some state over each invalidation; or in some exceptional circumstances you may want to return the previous value itself with no changes.

Usage

1
rx_calc_with_previous(func, initialValue = NULL)

Arguments

func

A function that takes a single parameter. Each time this function is called, it will be passed its previous return value.

initialValue

The value to pass to the function the first time it is called.

Value

An rx_calc based on the function.


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