3 ms·
> How does effect knows that it needs to call this lambda whenever parity gets changed? Basically all implementations of signals (by whatever name) build a dyn
by eyelidlessness 3y ago
> How does effect knows that it needs to call this lambda whenever parity gets changed?
Basically all implementations of signals (by whatever name) build a dynamic dependency graph, where edges are established by reading nodes. In a tracking context like this hypothetical `effect`, the read also establishes an edge between the signal’s state node and the effect’s computation node—effectively subscribing the latter to subsequent writes to the former, in order to determine when to rerun the computation.