Tips — javascript

RxJS: of explained

Posted by Tomasz Smykowski on

RxJS stands for Reactive Extensions for JavaScript. It is a great library to handle flow of items received by your application. Today you will learn what is one of the most commonly used RxJS operator: of. The documentation explains it nicely: But what does it really mean? Let's forget about the documentation for a moment. The analogy Imagine your team is fighting against some orks. You decide to throw at them short knives you were wearing on your belt. What happens is that you changed a bunch of knives into a sequence of knives heading towards your opponent. This is...

Read more →


RxJS: Map explained

Posted by Tomasz Smykowski on

RxJS stands for Reactive Extensions for JavaScript. It is a great library to handle flow of items received by your application. Today you will learn what is one of the most commonly used RxJS operator: map. The documentation offers a nice diagram with circles that is self-explanatory: But what does it really mean? Let's forget about the diagram for a moment. The analogy Imagine you are a blacksmith. The king ordered you to sharpen the edges of all swords of his army. Swords are gathered next to your tent, and you start to sharpen each sword, one by one. It...

Read more →


RxJS: takeUntil Explained

Posted by Tomasz Smykowski on

RxJS stands for Reactive Extensions for JavaScript. It is a great library to handle flow of items received by your application. Today you will learn what is one of the most commonly used RxJS operator: takeUntil. The documentation offers a diagram showing how takeUntil works: But what does it really mean? The analogy Imagine that you found a good place to collect herbs to prepare a healing potion for your team, when a team leader comes over and tells you have to prepare for the journey. You stop collecting herbs, and this is exactly how takeUntil operator works. It looks like this: Balls...

Read more →


RxJS: distinctUntilChanged Explained

Posted by Tomasz Smykowski on

RxJS stands for Reactive Extensions for JavaScript. It is a great library to handle flow of items received by your application. Today you will learn what is one of the most commonly used RxJS operator: filter. The documentation offers an explanation how the operator works: "Returns an Observable that emits all items emitted by the source Observable that are distinct by comparison from the previous item". But what does it really mean? The analogy Imagine your scouts come from the battlefield to give you information how the war zone looks like. However, reports duplicate. So sometimes you receive multiple reports with exactly the same...

Read more →


RxJS: Filter explained

Posted by Tomasz Smykowski on

RxJS stands for Reactive Extensions for JavaScript. It is a great library to handle flow of items received by your application. Today you will learn what is one of the most commonly used RxJS operator: filter. The documentation offers a nice diagram with circles that is self-explanatory: But what does it really mean? Let's forget about the diagram for a moment. The analogy Imagine you are recruiting an army of palladins. But you know your enemy sent also some spies that try to act as ones to join your forces and give away valuable information. Therefore you ask every recruit if he is able...

Read more →