Return an empty Observable

前端 未结 11 1033
北荒
北荒 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 19:07

    RxJS6 (without compatibility package installed)

    There's now an EMPTY constant and an empty function.

      import { Observable, empty, of } from 'rxjs';
    
      var delay = empty().pipe(delay(1000));     
      var delay2 = EMPTY.pipe(delay(1000));
    

    Observable.empty() doesn't exist anymore.

提交回复
热议问题