How to nest `condition` calls
mainBecause condition returns a Unit<T> (the same type as the source), you can nest condition calls to create complex conditional logic trees. This allows you to perform sequential checks on a single source payload.
const $value = createStore("hello@world");
const updateEmail = createEvent<string>();
condition({
source: $value,
if: (length) => length > 0,
then: condition({
if: (string) => string.includes("@"),
then: updateEmail,
}),
});