Understanding the Order of Effect Execution in Effect Typescript

A conceptual question. For the following, why does this work? as in why is .when second in the change? Can I always assume the when condition is true when conditional runs?

Internal i don't understand what order effect executes the effects

import { Effect } from "effect";

const conditional = Effect.succeed(1).pipe(() => Effect.log("hello"));

const program = conditional.pipe(Effect.when(() => 1 + 1 === 2));

Effect.runSync(program);
Was this page helpful?