RxJs

rxjs

of

 Rof(): Observable<any>{
    return  of(1,2,3,4)
  }
  Tof(){
    this.Rof().subscribe(
      next => console.log(‘next:‘, next),
      err => console.log(‘error:‘, err),
      () => console.log(‘the end‘),
    );
  }

/*
next: 1
next: 2
next: 3
the end
*/

from

  RFrom(): Observable<any>{
    return from([10, 20, 30], asyncScheduler)
  }
  TFrom(){
    this.RFrom().subscribe(
      next => console.log(‘next:‘, next),
      err => console.log(‘error:‘, err),
      () => console.log(‘the end‘),
    );
  }

/*
next: 10
next: 20
next: 30
the end
*/

rxjs/operators

RxJs

上一篇:jQuery中选择器(常见)


下一篇:linux中apache服务的访问控制(基于主机IP地址)