1// Requires RXJS 6+
2// Create an observable of any Type
3// Ask yourself if the function creates a new observable or not
4// If it creates a new one then it is imported from 'rxjs'
5// Operators are imported from 'rxjs/operators'
6import { of } from 'rxjs';
7
8// T => Observable<T>
9const value$ = of(1);
1
2 content_copy
3
4
5 open_in_new
6
7 function foo() {
8 console.log('Hello');
9 return 42;
10}
11
12const x = foo.call(); // same as foo()
13console.log(x);
14const y = foo.call(); // same as foo()
15console.log(y);
16