EFFECT — do something with side effects
EFFECT is where the work happens. It runs a function with the current value as input, and the result becomes the new value. The journal records the input and the output.
01The shape
EFFECT is where the work happens. It runs a function with the current value as input, and the result becomes the new value. The journal records the input and the output.
02Try it
03The law: associativity
EFFECTs compose. Doing A then B is the same as doing B then A, as long as the composition is well-defined. This is the same associativity as function composition. It means you can rearrange your code without changing the outcome — the substrate handles the reordering safely.
04What you can build
A reducer. A transformation pipeline. A worker. Anything that does work. The substrate is reactive: when an EFFECT runs, the journal records the result, listeners fire, and any cell that depends on this one re-runs its own EFFECT.
05Next
EFFECTs change the world. VIEWs read it without changing anything. Lesson 4: VIEW →