Skip to content

If

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; otherwise, the output of the action that was performed (i.e. Then or Else). Any
Predicate The predicate to evaluate in order to trigger Then (when true) or Else (when false). None Shard[Shard]
Then The shards to activate when Predicate is true. None Shard[Shard]
Else The shards to activate when Predicate is false. None Shard[Shard]
Passthrough The output of this shard will be its input. false Bool

Evaluates a predicate and executes an action.

Examples

1
2
3
4
5
6
7
8
5
(If
 ;:Predicate
 (IsLess 2)
 ;:Then
 (Msg "lesser than 2")
 ;:Else
 (Msg "equal or greater than 2"))
[info] [shards/General/If/If.edn] equal or greater than 2