5. PROGRAMMING PARADIGMS
It is a declarative
programming is done
with expressions. In
functional code, the
output value of a
function depends only
on the arguments that
are input to the
function, so calling a
function f twice with the
same value for an
argument x will produce
the same result f(x)
It is a programming
paradigm that uses
statements that change a
program's state. In much
the same way that the
imperative mood in
expresses commands, an
consists of commands
for the computer to
on describing how a
It is a programming
around data flows and
the propagation of
change. This means that
it should be possible to
express static or dynamic
data flows with ease in
languages used, and that
the underlying execution
model will automatically
through the data flow.
9. OBSERVER PATTERN
The observer pattern is a software design pattern in which an object,
called the subject, maintains a list of its dependents, called
observers, and notifies them automatically of any state changes,
usually by calling one of their methods. It is mainly used to implement
distributed event handling systems.
10. ITERATOR PATTERN
In object-oriented programming, the iterator pattern is a design
pattern in which an iterator is used to traverse a container and
access the container's elements. The iterator pattern decouples
algorithms from containers
12. “BACK-PRESSURE? WHAT?!
Main obstacle when you approach for the first time
Reactive Programming is the vocabulary.
My first suggestion is to familiarise with the domain, a lot
of concepts become way easier if you understand what
they mean before you start to work with them.
streams, hot observables, cold observables, marbles
diagram, back-pressure, operators...
A stream is a sequence of ongoing events
ordered in time. It can emit three different
things: a value (of some type), an error, or a
EVERYTHING CAN BE A STREAM
14. COLD OBSERVABLES
Cold observables start running upon
subscription: the observable sequence only starts
pushing values to the observers when subscribe
Values are also not shared among subscribers.
15. HOT OBSERVABLES
When an observer subscribes to a hot observable
sequence, it will get all values in the stream
that are emitted after it subscribes.
The hot observable sequence is shared among
all subscribers, and each subscriber is pushed
the next value in the sequence.
21. MVI RULES
▸ A module shouldn’t control
any other module (controller
▸ The only shared part between
modules are observables
▸ Intent is a component with
only one responsibility: It
should interpret what the
user is trying to do in terms
of model updates, and export
these "user intentions" as
Input: data events from the Model.
Output: a Virtual DOM rendering of the model,
and raw user input events (such as clicks,
keyboard typing, accelerometer events, etc).
25. MVI PROs
▸ Better separation of concern
▸ Monodirectional flow
▸ Dependency Injection
▸ Applications become easier
to test (in particular views)
▸ All the states live inside the
Model and the View is state-
Cycle’s core abstraction is your
application as a pure function main()
where inputs are read effects (sources)
from the external world and outputs
(sinks) are write effects to affect the
These side effects in the external world
are managed by drivers: plugins that
handle DOM effects, HTTP effects, etc.
Drivers are functions that listen to
Observable sinks (their input), perform
imperative side effects, and may return
Observable sources (their output).