'of' vs 'from' operator

后端 未结 7 2082
栀梦
栀梦 2020-11-29 17:18

Is the only difference between Observable.of and Observable.from the arguments format? Like the Function.prototype.call and Func

7条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-29 17:54

    1. from returns notification in chunks i.e. one by one. for eg: from("abcde") will return a => b => c => d => e
    2. of returns complete notification. for eg: of("abcde") will return abcde.

    https://stackblitz.com/edit/typescript-sckwsw?file=index.ts&devtoolsheight=100

提交回复
热议问题