I am trying to learn reactive programming using RxJS. I was trying to create an observable from an array using Observable.from() method, but I am getting an err
If you are using rxjs >=6.0.0 then you no longer use Observable.from
. Instead from
is a standalone function.
import { Observable, from} from 'rxjs';
//old way
var o = Observable.from([1, 2, 3, 4]);
//new way
var o = from([1, 2, 3, 4]);
I hope this is helpful since it took me a while to figure this out.