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 putConfiguration<
U extends Record<string, InMemoryFlagVariants<string>> = Record<string, InMemoryFlagVariants<string>>,
>(flagConfiguration: InMemoryFlagConfiguration<U>) {
super.putConfiguration(flagConfiguration);
// custom logic ...
}
}
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
variantsobject in each flag specification are consistent with thedefaultVariantand the return type ofcontextEvaluator.