Is your feature request related to a problem? Please describe.
As a developer develping a feature behind a flag, during the development (pre-release) phase I'd like an easy way to toggle the state of a flag for testing, without the requirement to change the state of the flag in the Feature Flag service (which may affect other developers or may require a workflow).
Describe the solution you'd like
We'd like a way to provide an object with flag states that will override any cached/retrieved flags. This is very similar to how defaultFlags works, but these "override` flags should take precedence.
Describe alternatives you've considered
I read through the documentation about defaultFlags, which I initially might solve this issue. But it looks like the intention with this is to provide a set of flags to be used only when there are no retreived/cached flag values. For the use case I described, we'd want to explicitly override the retreived/cached flags even when they're present, in order to force a flag to a specific state for testing. I can see in the code here that when the cached flags are present they would overwrite any defaultFlags:
Additional context
Add any other context or screenshots about the feature request here.
Is there any way to achieve this in the current implementation of FlopFlip?
Or would something like this require us to create a custom adapterArg and then use this in our execute function to manually override the cached flags?
Thanks.
Is your feature request related to a problem? Please describe.
As a developer develping a feature behind a flag, during the development (pre-release) phase I'd like an easy way to toggle the state of a flag for testing, without the requirement to change the state of the flag in the Feature Flag service (which may affect other developers or may require a workflow).
Describe the solution you'd like
We'd like a way to provide an object with flag states that will override any cached/retrieved flags. This is very similar to how
defaultFlagsworks, but these "override` flags should take precedence.Describe alternatives you've considered
I read through the documentation about
defaultFlags, which I initially might solve this issue. But it looks like the intention with this is to provide a set of flags to be used only when there are no retreived/cached flag values. For the use case I described, we'd want to explicitly override the retreived/cached flags even when they're present, in order to force a flag to a specific state for testing. I can see in the code here that when the cached flags are present they would overwrite anydefaultFlags:flopflip/packages/cache/src/cache.ts
Line 135 in e9f4d0a
Additional context
Add any other context or screenshots about the feature request here.
Is there any way to achieve this in the current implementation of FlopFlip?
Or would something like this require us to create a custom
adapterArgand then use this in ourexecutefunction to manually override the cached flags?Thanks.