Binary Operators
The package also provides a set of binary operators that can be used to combine the evaluation of different features. The operators are:
and: Returnstrueif the features are evaluated totrue.or: Returnstrueif at least one of the features is evaluated totrue.iff: Returnstrueif the features' evaluation is the same (in type and value).implies: Returnstrueif the logical implication between features is correct. Given two features: A and B, on which A implies B; if feature A istrue, B must be.falsewill be returned if not.
The usage of the operators is as follows:
<Feature>
<On expression={and(feature("feature1"), feature("feature2"))}>
<p>Feature 1 and feature 2 are enabled</p>
</On>
...
</Feature>
<Feature>
<On expression={or(feature("feature1"), feature("feature2"))}>
<p>Feature 1 or feature 2 are enabled</p>
</On>
...
</Feature>
<Feature>
<On expression={iff(feature("feature1"), feature("feature2"))}>
<p>Feature 1 has the same evaluation as feature 2</p>
</On>
...
</Feature>
<Feature>
<On expression={implies(feature("feature1"), feature("feature2"))}>
<p>Because Feature 1 is enabled, feature 2 must be</p>
</On>
...
</Feature>