Two fundamental abstractions
summary
Argues that two primitives — a no-arg getter and a single-arg setter — compose into useful abstractions: implements getter getters to create lazy ranges (10..15 yields six values) and uses Symbol.iterator / Symbol.iterator + next to make those ranges iterable without allocating arrays, then composes filter and concat operators. Implements setter-based callbacks as subscribable streams (Observable-like) using plain JavaScript and addEventListener examples; demos run live and the tiny prototypes work.
AI-written summary · about
chapters (5)
- 0:00Start
- 2:35Fundamental Abstractions the Getter and the Setter
- 12:52Lazy Initialization
- 14:11For Loop
- 19:11Anti-Pattern
related talks
30mJavaScript Generators — Practical Use Cases
27mA, B, C. 1, 2, 3. Iterables you and me
38mExploring the Enigmatic: Navigating JS's Uncharted Realms
49mGoing Functional with JS
27mPractical functional programming: pick two
28mWhat happens next: a choose-your-own-adventure with iterators
25mReinventing RxJS
39mInvent the future, don't recreate the past
