Return an empty Observable

前端 未结 11 1043
北荒
北荒 2020-11-30 18:23

The function more() is supposed to return an Observable from a get request

export class Collection{

    public more = (): Observab         


        
11条回答
  •  佛祖请我去吃肉
    2020-11-30 18:59

    Several ways to create an Empty Observable:

    They just differ on how you are going to use it further (what events it will emit after: next, complete or do nothing) e.g.:

    • Observable.never() - emits no events and never ends.
    • Observable.empty() - emits only complete.
    • Observable.of({}) - emits both next and complete (Empty object literal passed as an example).

    Use it on your exact needs)

提交回复
热议问题