FRP, or Functional Reactive Programming, has some basic terms which you need to know.
Every piece of data can be represented as Observable
, which is an asynchronous data stream. The power of FRP is in representation synchronous and asynchronous events as streams, Observable
s, and providing the same interface to work with it.
Usually Observable
holds several (or none) events that holds the date - .Next
events, and then it can be terminated successfully (.Success
) or with an error (.Error
).
Let's take a look at following marble diagram:
--(1)--(2)--(3)|-->
In this example there is a stream of Int
values. As time moves forward, three .Next
events occurred, and then the stream terminated successfully.
--X->
The diagram above shows a case where no data was emitted and .Error
event terminates the Observable
.
Before we move on, there are some useful resources: