has_updated: Detect if a UI element has updated

View source: R/formods.R

has_updatedR Documentation

Detect if a UI element has updated

Description

Takes a UI element value and an older value and determines if it has been modified

Usage

has_updated(ui_val = NULL, old_val = NULL, init_val = NULL)

Arguments

ui_val

Current value from the UI.

old_val

Last value of of the element. defined.

init_val

List of values to skip. These are values expected to be assigned on initialization. For buttons it may be 0. For others it may be "".

Value

Boolean result of the comparison

Examples

changed_true  = has_updated(ui_val = "a", old_val = "")
changed_true
changed_false = has_updated(ui_val = "a", old_val = "a")
changed_false

formods documentation built on April 12, 2025, 1:57 a.m.