1

Say I have features A, B, C, and A is enabled by default. B and C disabled.

When I enable B I want to disable A: only one feature should be enabled at a time.

Nathaniel Ford
  • 20,545
  • 20
  • 91
  • 102
Moon
  • 13
  • 4

1 Answers1

3

You'll need to implement a custom version of the StateRepository interface. Information on this can be found on the togglz documentation

Next override the setFeatureState(...) function for the required functionality.

  • Disable active features (query via FeatureManager or Feature enum - you may need to implement custom versions of these classes for the desired functionality)
  • Enable the feature being set.
eddie-ryan
  • 285
  • 1
  • 5
  • 19