from
``# from
💡 This operator can be used to convert a promise to an observable!
💡 For arrays and iterables, all contained values will be emitted as a sequence!
💡 This operator can also be used to emit a string as a sequence of characters!
Example 1: Observable from array
// RxJS v6+
import { from } from 'rxjs';
//emit array as a sequence of values
const arraySource = from([1, 2, 3, 4, 5]);
//output: 1,2,3,4,5
const subscribe = arraySource.subscribe(val => console.log(val));
Example 2: Observable from promise
// RxJS v6+
import { from } from 'rxjs';