typed-feature-flagging
Goals
- able to substitute drivers
- ie Unleash, LaunchDarkly, etc.
- boolean feature flag (true/false) results
- upstream driver failures will result in false (disabled)
- exhaustive list of feature flags are defined ahead of time and typed (enums)
- each feature flag may have a context type
- if there was a context for the feature flag it MUST BE provided
- the context is typed on a per feature flag basis (the user of the library must define the mapping of the feature flag name to the type of its value)
Desired API
Without a Context
enabled(FeatureFlag.WITHOUT_CONTEXT): boolean
If the developer had attempted to provide a context, there should have been a TS lint error indicating that the context value was not needed.
With a Context
enabled(FeatureFlag.WITH_CONTEXT, { ... }): boolean
If the developer had attempted to NOT provide a context, there should have been a TS lint error indicating that the context value was mandatory.