EssentialGG / Vigilance

Configuration Utility using Elementa
GNU Lesser General Public License v3.0
54 stars 12 forks source link

Add ability to specify dependency value via predicate #78

Closed BlackBeltPanda closed 1 year ago

BlackBeltPanda commented 1 year ago

Allows setting to depend on another setting's value, regardless of type.

Johni0702 commented 1 year ago

Not sure if we should be adding more only-with-this-specific-value type of dependency methods. Those are bound to be insufficient for some use case rather sooner than later, like what if I want to show the setting if the dependent setting is within a range instead of just a specific value? Can we not just have a universal addDependency method that just takes an additional (value: T) -> Boolean?

BlackBeltPanda commented 1 year ago

Not sure if we should be adding more only-with-this-specific-value type of dependency methods. Those are bound to be insufficient for some use case rather sooner than later, like what if I want to show the setting if the dependent setting is within a range instead of just a specific value? Can we not just have a universal addDependency method that just takes an additional (value: T) -> Boolean?

That sounds like the best way to go. Do we want to deprecate the existing methods, as well?