View source: R/feature_flag-env_var.R
is_enabled.env_var_feature_flag | R Documentation |
Checks if the given environment variable feature flag is enabled
## S3 method for class 'env_var_feature_flag'
is_enabled(feature_flag)
feature_flag |
Flag to be checked whether it is enabled |
TRUE if the environment variable is set to 'true'
{
flag <- create_env_var_feature_flag("FEATURE_X")
withr::with_envvar(new = list(FEATURE_X = "true"), {
is_enabled(flag) # Returns TRUE
})
is_enabled(flag) # Returns FALSE by default
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.