70. implement Observable.from()
Share
medium - accepted / - tried
This is a follow-up on 57. create an Observable.
Suppose you have solved 57. create an Observable, here you are asked to implement a creation operator from()
.
From the document, from()
Creates an Observable from an Array, an array-like object, a Promise, an iterable object, or an Observable-like object.
Your from()
should accept all above types.
from([1,2,3]).subscribe(console.log);// 1// 2// 3
Note
- Observable is already given for you, no need to create it.
- for the problem here,
Observable-like
meansObservable instance
. Though in real-world you should checkSymbol.observable