Skip to content

basalt / flags/src / FeatureFlags

Class: FeatureFlags<TShape> ​

Defined in: flags/src/index.ts:44

Type Parameters ​

TShape ​

TShape extends FlagsShape

Constructors ​

Constructor ​

> new FeatureFlags<TShape>(defs): FeatureFlags<TShape>

Defined in: flags/src/index.ts:45

Parameters ​

defs ​

TShape

Returns ​

FeatureFlags<TShape>

Methods ​

all() ​

> all(context?): { [K in string | number | symbol]: FlagValue<TShape[K]> }

Defined in: flags/src/index.ts:78

Resolves every flag — handy for bootstrapping a client.

Parameters ​

context? ​

FlagContext

Returns ​

{ [K in string | number | symbol]: FlagValue<TShape[K]> }


enabled() ​

> enabled<K>(key, context?): boolean

Defined in: flags/src/index.ts:73

True when the flag resolves to true.

Type Parameters ​

K ​

K extends string | number | symbol

Parameters ​

key ​

K

context? ​

FlagContext

Returns ​

boolean


value() ​

> value<K>(key, context?): FlagValue<TShape[K]>

Defined in: flags/src/index.ts:48

Resolves a flag against the given (or current request) context.

Type Parameters ​

K ​

K extends string | number | symbol

Parameters ​

key ​

K

context? ​

FlagContext

Returns ​

FlagValue<TShape[K]>

Released under the MIT License.