‘of’ vs ‘from’ operator

It is important to note the difference between of and from when passing an array-like structure (including strings): Observable.of([1, 2, 3]).subscribe(x => console.log(x)); would print the whole array at once. On the other hand, Observable.from([1, 2, 3]).subscribe(x => console.log(x)); prints the elements 1 by 1. For strings the behaviour is the same, but at character … Read more

Create one-time subscription

Not 100% certain about what you need, but if you only want to observe the first value, then use either first() or take(1): observable.first().subscribe(func); note: .take(1) and .first() both unsubscribe automatically when their condition is met Update from RxJS 5.5+ From comment by Coderer. import { first } from ‘rxjs/operators’ observable .pipe(first()) .subscribe(func); Here’s why

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)