View Source GrowthBook.FeatureResult (GrowthBook v0.3.0)
Struct holding results of an evaluated Feature.
Holds the result of a feature evaluation, and is used to check if a feature is enabled, and optionally what data it provides, if that was configured.
Link to this section Summary
Functions
Helper function to convert string sources to atoms
Link to this section Types
Specs
source() :: :unknown_feature | :cyclic_prerequisite | :prerequisite | :default_value | :force | :experiment
The source of a feature
Specs
t() :: %GrowthBook.FeatureResult{ experiment: GrowthBook.Experiment.t() | nil, experiment_result: GrowthBook.ExperimentResult.t() | nil, off: boolean(), off?: boolean(), on: boolean(), on?: boolean(), source: source(), value: term() }
Feature result
The result of evaluating a GrowthBook.Feature
. Has a number of keys:
value
(term/0
) - The assigned value of the featureon
/on?
(boolean/0
) - The assigned value cast to a booleanoff
/off?
(boolean/0
) - The assigned value cast to a boolean and then negatedsource
(source/0
) - The source of the feature resultexperiment
(GrowthBook.Experiment.t/0
ornil
) - When source is:experiment
, this will be an%GrowthBook.Experiment{}
structexperiment_result
(GrowthBook.ExperimentResult.t/0
ornil
) - When source is:experiment
, this will be an%GrowthBook.ExperimentResult{}
struct
Link to this section Functions
Specs
Helper function to convert string sources to atoms