feature_if {featureflag}R Documentation

Evaluates the provided expression if the feature flag is enabled.

Description

Evaluates the provided expression if the feature flag is enabled.

Usage

feature_if(feature_flag, expr)

Arguments

feature_flag

flag which defines whether the provided expression should be evaluated

expr

expression to evaluate when the feature_flag is enabled

Details

The passed expression is evaluated in the frame where feature_if is called.

Value

If the passed feature_flag is enabled, than the result of the evaluation of the passed expression is returned. Otherwise there is no return value.

Examples

{
  flag <- create_bool_feature_flag(TRUE)

  feature_if(flag, {
    2 + 7
  })
}

[Package featureflag version 0.1.0 Index]