Skip to main content

signal_is_truthy

Function signal_is_truthy 

Source
pub fn signal_is_truthy(value: &str) -> bool
Expand description

Whether a signal’s stringified value counts as true.

Empty, "false" and "0" are false; anything else is true. This is the rule an <if> gate evaluates. Anything that decides the same branch somewhere else, such as a build step rendering it ahead of the runtime, applies this rule rather than one of its own.

A signal that was never written is false. Callers holding an Option<&str> spell that out with is_some_and, which keeps the missing case visible at the call site.