In the push model, a producer decides when to send data. A consumer subscribes, then reacts as values arrive rather than repeatedly asking for them. A button click is a push event; calling a function or an iterator’s next method is pull. section 9.3.1
The distinction matters when choosing how to handle incoming values:
- A Promise supplies one pushed value. A stream can deliver successive values as they become available. section 9.3.1
- For incoming chat messages, periodic polling can produce awkwardly large responses. A push stream can notify the application of messages individually or in small batches. section 9.0
Make an array notify subscribers
An array normally exposes values for consumers to retrieve. A push-enabled array can instead use an EventEmitter: its push(value) method emits an event, and subscribe({ next(value) { … } }) registers a consumer for that event. The subscriber runs when a new value is pushed, without polling the array. section 9.3.2
An Observable gives this flow a reusable interface. It models a lazy push-based source: subscribing starts the flow, an observer receives values through next, and a subscription provides unsubscribe. The observer can also handle errors and completion. section 9.4.1
Add push behavior without changing the data structure
A Proxy can intercept an existing object’s push calls and emit each added value to observable subscribers. With a reactivized array, a subscriber can filter even numbers, square them, and receive the result when 6 is pushed. The observable also replays values already in the array when subscribed to. section 9.4.8



