WarsawJS Slides: Template

We talk about JavaScript. Each month in Warsaw, Poland.

Robert Gurgul

"Introduction to Reactive programming"

2016-04-13

gurgul.robert@gmail.com

Reactive programming

like youtube subscription

Classical programming

like google or youtube search

Where is problem (classical array approach)?

Reactive way

Another problem
Callback hell - aka “the flying V”

Promises provide a cleaner solution

We can compare Rx to promise.

However promises has 2 problems:

ReactiveX is a combination of the best ideas from the

It's mainly programming with event streams.

What is an event stream?

It's a sequence of events happening over time.

eg. interval, promise, data change, form change

How to define it?

Create interval:

The functional style of Rx made the code look more declarative than imperative.

no if, no for-loop

Rx operators by examples

Calorie calculator:

http://js.edu.pl/rx/warsawjs/calc.html

Calorie calculator code:

Rx operators by examples
easy geme:

http://js.edu.pl/rx/warsawjs/game.html

thanks!