Open in app

Sign In

Write

Sign In

Wojciech Trawiński
Wojciech Trawiński

1.9K Followers

Home

About

Published in JavaScript everyday

·Pinned

JavaScript Theory: Promise vs Observable

The RxJS is currently by far the hottest JavaScript library, which is widely used especially in Angular single page applications. When you are first introduced to the library and the notion of the Observable, you may hear that it’s the Promise with multiple values or an asynchronous collection of data…

Rxjs

3 min read

JavaScript Theory: Promise vs Observable
JavaScript Theory: Promise vs Observable
Rxjs

3 min read


Published in JavaScript everyday

·Feb 13

RxJS hint [filter, skipWhile]

This hint covers the difference between the filter and skipWhile operators from the RxJS library. According to the official documentation: filter Filter items emitted by the source Observable by only emitting those that satisfy a specified predicate. skipWhile Returns an Observable that skips all items emitted by the source Observable as long as a specified condition holds true, but emits all further source items as soon as the condition becomes false.

Rxjs

2 min read

RxJS hint [filter, skipWhile]
RxJS hint [filter, skipWhile]
Rxjs

2 min read


Published in JavaScript everyday

·Feb 6

RxJS hint [repeat]

This hint covers usage of the repeat operator from the RxJS library in the current version which deprecates the repeatWhen operator. According to the official documentation: repeat Returns an Observable that will resubscribe to the source stream when the source stream completes. repeatWhen (deprecated) Returns an Observable that mirrors the…

Rxjs

4 min read

RxJS hint [repeat]
RxJS hint [repeat]
Rxjs

4 min read


Published in JavaScript everyday

·Feb 2

RxJS hint [retry]

This hint covers usage of the retry operator from the RxJS library in the current version which deprecates the retryWhen operator. According to the official documentation: retry Returns an Observable that mirrors the source Observable with the exception of an error. retryWhen (deprecated) Returns an Observable that mirrors the source…

Rxjs

4 min read

RxJS hint [retry]
RxJS hint [retry]
Rxjs

4 min read


Published in JavaScript everyday

·Jan 26

NG hint [providedIn: ‘root’]

This hint covers why it is not a good idea to instantiate all singleton services at the root injector’s level. I have recently stumbled across the following advice referred to as the golden rule for providing services: Whenever possible, use @Injectable({providedIn: 'root'}) Although it is a legitimate approach performance-wise, since…

Angular

3 min read

NG hint [providedIn: ‘root’]
NG hint [providedIn: ‘root’]
Angular

3 min read


Published in JavaScript everyday

·Jan 22

Config based service implementation in Angular

Angular framework takes advantage of the Dependency Injection mechanism in a lot of places. For instance, you can use an abstract class as a token and instruct to instantiate a service with the aid of different concrete classes depending on a situation. …

Angular

7 min read

Config based service implementation in Angular
Config based service implementation in Angular
Angular

7 min read


Published in JavaScript everyday

·Jan 20

RxJS hint [finalize, complete/error]

This hint covers the difference between the finalize operator and complete/error callbacks passed to either the tap operator or subscribe method from the RxJS library. According to the official documentation: finalize Returns an Observable that mirrors the source Observable, but will call a specified function when the source terminates on…

Rxjs

2 min read

RxJS hint [finalize, complete/error]
RxJS hint [finalize, complete/error]
Rxjs

2 min read


Published in JavaScript everyday

·Jan 17

Angular app’s configuration

Angular framework is a perfect choice for developing enterprise applications. In such products, you will probably need to come up with a solution which allows an application to work differently based on a given context. For instance, more verbose logging may be desired during development or API endpoints may differ…

Angular

8 min read

Angular app’s configuration
Angular app’s configuration
Angular

8 min read


Published in JavaScript everyday

·Jan 14

RxJS hint [BehaviorSubject, ReplaySubject(1)]

This hint covers the difference between the BehaviorSubject and ReplaySubject(1) classes from the RxJS library. According to the official documentation: BehaviorSubject A variant of Subject that requires an initial value and emits its current value whenever it is subscribed to. ReplaySubject A variant of Subject that “replays” old values to…

Rxjs

3 min read

RxJS hint [BehaviorSubject, ReplaySubject(1)]
RxJS hint [BehaviorSubject, ReplaySubject(1)]
Rxjs

3 min read


Published in JavaScript everyday

·Jan 8

RxJS hint [first, take(1)]

This hint covers the difference between the first and take(1) operators from the RxJS library, including the scenario with a predicate function. According to the official documentation: first Emits only the first value (or the first value that meets some condition) emitted by the source Observable. take Emits only the…

Rxjs

3 min read

RxJS hint [first, take(1)]
RxJS hint [first, take(1)]
Rxjs

3 min read

Wojciech Trawiński

Wojciech Trawiński

1.9K Followers

Doing awesome things using JavaScript

Following
  • Max Koretskyi

    Max Koretskyi

  • Netanel Basal

    Netanel Basal

  • Kevin Kreuzer

    Kevin Kreuzer

  • Tomas Trajan

    Tomas Trajan

  • Tomasz Kula

    Tomasz Kula

See all (27)

Help

Status

Writers

Blog

Careers

Privacy

Terms

About

Text to speech