Tuesday, 1 September 2020

Of VS FROM

 Not quite. When passing an array to Observable.from, the only difference between it and Observable.of is the way the arguments are passed.

However, Observable.from will accept an argument that is

a subscribable object, a Promise, an Observable-like, an Array, an iterable or an array-like object to be converted

There is no similar behaviour for Observable.of - which always accepts only values and performs no conversion.


https://stackoverflow.com/questions/42704552/of-vs-from-operator#:~:text=When%20passing%20an%20array%20to,difference%20between%20it%20and%20Observable.&text=There%20is%20no%20similar%20behaviour,values%20and%20performs%20no%20conversion.

No comments:

Post a Comment