Type Alias InMemoryFlagConfiguration<T>

InMemoryFlagConfiguration<T>: FlagConfiguration<T>

The configuration object for the TypedInMemoryProvider, containing all flags and their specifications.

Can be used in combination with InMemoryFlagVariants to preserve type-safety when extending the provider class.

The generic ensures that the keys of the variants object in each flag specification are consistent with the defaultVariant and the return type of contextEvaluator.

Type Parameters

  • T extends Record<string, FlagVariants<string>> = Record<string, FlagVariants<string>>
export class CustomInMemoryProvider<
T extends Record<string, InMemoryFlagVariants<string>> = Record<string, InMemoryFlagVariants<string>>,
> extends TypedInMemoryProvider<T> {
constructor(flagConfiguration: InMemoryFlagConfiguration<T>) {
super(flagConfiguration);
// custom logic ...
}

override async putConfiguration<
U extends Record<string, InMemoryFlagVariants<string>> = Record<string, InMemoryFlagVariants<string>>,
>(flagConfiguration: InMemoryFlagConfiguration<U>) {
await super.putConfiguration(flagConfiguration);
// custom logic ...
}
}