// RxJS v6+import { from } from'rxjs';//emit array as a sequence of valuesconstarraySource=from([1,2,3,4,5]);//output: 1,2,3,4,5constsubscribe=arraySource.subscribe(val =>console.log(val));
// RxJS v6+import { from } from'rxjs';//emit result of promiseconstpromiseSource=from(newPromise(resolve =>resolve('Hello World!')));//output: 'Hello World'constsubscribe=promiseSource.subscribe(val =>console.log(val));
// RxJS v6+import { from } from'rxjs';//emit string as a sequenceconstsource=from('Hello World');//output: 'H','e','l','l','o',' ','W','o','r','l','d'constsubscribe=source.subscribe(val =>console.log(val));