Skip to content

When

Name - Description Default Type
<input> The value that will be passed to the predicate. Any
<output> The input of the shard if Passthrough is true, or the Predicate is false; otherwise, the output of the Action. Any
Predicate The predicate to evaluate in order to trigger Action. None Shard[Shard]
Action The shards to activate on when Predicate is true for When and false for WhenNot. None Shard[Shard]
Passthrough The output of this shard will be its input. true Bool

Conditional shard that only executes the action if the predicate is true.

Examples

1
2
3
4
5
6
64
(When
 ;:Predicate
 (IsMore 50)
 ;:Action
 (Msg "More than 50"))
[info] [shards/General/When/When.edn] More than 50