feature_if: Evaluates the provided expression if the feature flag is...

Description Usage Arguments Details Value Examples

View source: R/helpers.R

Description

Evaluates the provided expression if the feature flag is enabled.

Usage

1
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

1
2
3
4
5
6
7
{
  flag <- create_bool_feature_flag(TRUE)

  feature_if(flag, {
    2 + 7
  })
}

featureflag documentation built on Feb. 18, 2021, 5:06 p.m.