The cell pattern
We have already learned that reactive programming is all about processing values that vary over time. They are centered on the notion of observables. There are two variants, which are as follows:
- Cells: A cell is an entity (a variable, or a memory location) where values are regularly updated over time. They are also called properties or behaviors, in some contexts.
- Streams: A stream represents a stream of events. They are data that is often associated with actions. When people think of observables, they have got Stream variant of Observables.
We will implement a toy version of a cell-programming pattern. We will only focus on implementing basic functionality. The code needs tidying up for production use.
The following implementation can be optimized, if we are implementing a Cell Controller class that each Cell will notify, when there is change in them. Then, the cell controller class can update the dependencies by evaluating expressions. This implementation shows how the cell...