Skip to content

Latest commit

 

History

History
41 lines (27 loc) · 850 Bytes

reactive-programming.md

File metadata and controls

41 lines (27 loc) · 850 Bytes

wtf is reactive programming

WIP

Streams

A stream is a sequence of on going events ordered in time.

####It can emit:

  • A value (of some type)
  • An error
  • A completed signal

####Capturing Asynchronously capture these events using different emitter type functions.

  • Define a function which executes when:
    • A value is emitted
    • An error is emitted
    • 'completed' is emitted

Listening to the stream is called subscribing. The functions we define are observers. The stream is the subject being observed.

This is precisely the Observer Design Pattern.

ASCII diagram:

--a---b-c---d---X---|->

a, b, c, d are emitted values
X is an error
| is the 'completed' signal
---> is the timeline