Add FeatureSwitchProvider and use it for 'show Gu suppliers' functionality #149
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this change?
Adds a
FeatureSwitchProvider
object which contains config for feature switches, and exposes a limited set of public methods that will hopefully make feature switch use intuitive and clear, i.e. it currently just exposes lists of switches, which have anisOn
method.Possibly over-engineering given that we've only got a single case at the moment. I lean towards thinking it's worthwhile because it will hopefully help us stay disciplined when adding this kind of logic, but open to other perspectives.
Also refactors the client side filtering out of
Gu*
suppliers so that it consumes the same switch, rather than consuming a list of suppliers to filter out. There's a bit more code duplication here but it seems overall simpler to have the contract between the client and server fit the same model as the switch mechanism here.How to test
How can we measure success?
Have we considered potential risks?
Images
Accessibility