View Source GrowthBook.ParentCondition (GrowthBook v0.3.0)

A ParentCondition defines a prerequisite.

Instead of evaluating against attributes, the condition evaluates against the returned value of the parent feature. The condition will always reference a "value" property. Here is an example of a gating prerequisite where the parent feature must be toggled on:

%ParentCondition{
  id: "parent-feature",
  condition: %{
    "value": {
      "$exists": true
    }
  },
  gate: true
}

Link to this section Summary

Types

t()

ParentCondition

Link to this section Types

Specs

Specs

t() :: %GrowthBook.ParentCondition{
  condition: GrowthBook.Condition.t(),
  gate: boolean(),
  id: String.t()
}

ParentCondition

A ParentCondition consists of a parent feature's id (string), a condition (Condition), and an optional gate (boolean) flag.

  • id (String.t/0) - parent feature's id
  • condition (GrowthBook.Condition.t/0) - condition
  • gate (boolean/0) - If gate is true, then this is a blocking feature-level prerequisite; otherwise it applies to the current rule only.

Link to this section Functions

Link to this function

eval(context, arg2, path)

View Source

Specs

eval(GrowthBook.Context.t(), [t()] | nil, [String.t()]) ::
  true | false | {:error, error()}

Specs

from_json(map()) :: t()