A deep dive into three reactive programming algorithms: push-based, pull-based, and hybrid push-pull reactivity. Using a spreadsheet as the mental model, the post defines four key requirements for reactive systems (efficient, fine-grained, glitchless, and dynamic), then analyzes how each algorithm meets or fails those requirements. Push-based reactivity is fine-grained but prone to redundant updates and glitches. Pull-based reactivity is naturally glitchless and supports dynamic dependencies but struggles with knowing which nodes to update. Push-pull reactivity combines both approaches using a dirty-flag mechanism to first mark affected nodes (push), then lazily recalculate only those nodes (pull), satisfying all four requirements efficiently.
Table of contents
The Problem StatementPush-Based ReactivityPull-Based ReactivityPush-Pull ReactivityConclusionSort: