Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for fallback function #60

Closed
ivarconr opened this issue Oct 22, 2019 · 0 comments
Closed

feat: add support for fallback function #60

ivarconr opened this issue Oct 22, 2019 · 0 comments

Comments

@ivarconr
Copy link
Member

ivarconr commented Oct 22, 2019

Today it is possible to define a fallback value which the IsEnabled will return if the feature toggle is not defined.

We want to also allow the user to send in a fallbackFunction instead of a fallback value (which will take precedence over fallback value).

The fallback function should get to arguments injected: toggleName and unleashContext.

Example on how it would work:

unleash.IsEnabled("foobar", unleash.WithFallbackFunction(myFunc))

If the user injects both a fallback value and fallbackFunction, like the example below, the result should be to only call the fallback function in the scenario that the toggle is not defined:

unleash.IsEnabled("foobar", unleash.WithFallback(true), unleash.WithFallbackFunction(myFunc))
jrbarron added a commit that referenced this issue Oct 24, 2019
This allows users to specify a dynamic fallback instead of falling back
to a fixed boolean value.

Fixes #60
jrbarron added a commit that referenced this issue Nov 5, 2019
This allows users to specify a dynamic fallback instead of falling back
to a fixed boolean value.

Fixes #60
@ivarconr ivarconr closed this as completed Nov 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant