booleanFlag
function booleanFlag(key, config?): Flag;Defined in: testing.ts:58
Build a boolean flag (variants on/off).
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
key |
string |
config? |
{ default?: boolean; enabled?: boolean; fallthrough?: Serve; overrides?: Override[]; rules?: Rule[]; } |
config.default? |
boolean |
config.enabled? |
boolean |
config.fallthrough? |
Serve |
config.overrides? |
Override[] |
config.rules? |
Rule[] |
Returns
Section titled “Returns”Example
Section titled “Example”import { booleanFlag } from "@xtandard/flags/testing";
const flag = booleanFlag("dark-mode", { default: true });// flag.type === "boolean", flag.defaultVariant === "on"