This repository was archived by the owner on May 30, 2024. It is now read-only.
This repository was archived by the owner on May 30, 2024. It is now read-only.
Allow lazily computed defaultValues in LDClient to improve code readability #284
Closed
Description
Is your feature request related to a problem? Please describe.
When using the LDCLient
, it'd be nice if the code could always read as:
- "get this feature flag value from launchdarkly, or fallback to
defaultValue
"
However, when the defaultValue
takes multiple lines to compute, it reads as something like:
- "here's some default feature value for some flag I haven't read yet"
- "now it's getting a flag value from LaunchDarkly, and it's falling back to the default value computed above"
It's less readable because the code is read in reverse order of its logic
Describe the solution you'd like
Code and logic are in the same order, using overloaded methods on LDClient
methods (for boolean, int, and double) like:
EvaluationDetail<Boolean> boolVariationDetail(String featureKey, LDUser user, Supplier<Boolean> defaultValueSupplier)
Happy to create a MR for this if you agree it's worth adding
Metadata
Metadata
Assignees
Labels
No labels