Featurevisor.Child (featurevisor v0.1.0)

Copy Markdown View Source

A child Featurevisor instance with isolated context and sticky state.

Summary

Functions

Closes child listeners and delegated subscriptions.

Returns whether a feature is enabled.

Evaluates a flag through the parent instance.

Evaluates a variable through the parent instance.

Evaluates a variation through the parent instance.

Evaluates all or selected features through the parent instance.

Returns the effective child context.

Returns a list variable after runtime type checking.

Returns a boolean variable after runtime type checking.

Returns a finite numeric variable after runtime type checking.

Returns an integer variable after runtime type checking.

Returns a map variable after runtime type checking.

Returns a string variable after runtime type checking.

Subscribes to a child or delegated parent event.

Merges or replaces child context.

Merges or replaces child sticky values.

Types

t()

@opaque t()

Functions

close(child)

Closes child listeners and delegated subscriptions.

enabled?(child, key, context \\ %{}, options \\ %{})

Returns whether a feature is enabled.

evaluate_flag(child, key, context \\ %{}, options \\ %{})

@spec evaluate_flag(t(), String.t(), map(), map()) :: Featurevisor.Evaluation.t()

Evaluates a flag through the parent instance.

evaluate_variable(child, key, variable, context \\ %{}, options \\ %{})

Evaluates a variable through the parent instance.

evaluate_variation(child, key, context \\ %{}, options \\ %{})

Evaluates a variation through the parent instance.

get_all_evaluations(child, context \\ %{}, feature_keys \\ [], options \\ %{})

Evaluates all or selected features through the parent instance.

get_context(child, context \\ %{})

Returns the effective child context.

get_variable(child, key, variable, context \\ %{}, options \\ %{})

Returns a variable value.

get_variable_array(child, key, variable, context \\ %{}, options \\ %{})

Returns a list variable after runtime type checking.

get_variable_boolean(child, key, variable, context \\ %{}, options \\ %{})

Returns a boolean variable after runtime type checking.

get_variable_double(child, key, variable, context \\ %{}, options \\ %{})

Returns a finite numeric variable after runtime type checking.

get_variable_integer(child, key, variable, context \\ %{}, options \\ %{})

Returns an integer variable after runtime type checking.

get_variable_json(child, key, variable, context \\ %{}, options \\ %{})

Returns a decoded JSON variable.

get_variable_object(child, key, variable, context \\ %{}, options \\ %{})

Returns a map variable after runtime type checking.

get_variable_string(child, key, variable, context \\ %{}, options \\ %{})

Returns a string variable after runtime type checking.

get_variation(child, key, context \\ %{}, options \\ %{})

Returns a variation value.

on(child, event, callback)

Subscribes to a child or delegated parent event.

set_context(child, context, replace \\ false)

Merges or replaces child context.

set_sticky(child, sticky, replace \\ false)

Merges or replaces child sticky values.