首页 > Web开发 > 详细

RxJs

时间:2020-12-18 14:36:53      阅读:18      评论:0      收藏:0      [点我收藏+]

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

原文:https://www.cnblogs.com/icxldd/p/14154608.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!