RxJS入門2之Rxjs的安裝

RxJS V6.0+ 安裝

RxJS 的 import 路徑有如下 5 種:
1.建立 Observable 的方法、types、schedulers 和一些工具方法web

import { Observable, Subject, asapScheduler, pipe, of, from, interval, merge, fromEvent, SubscriptionLike, PartialObserver } from 'rxjs';

2.操做符 operatorsajax

import { map, filter, scan } from 'rxjs/operators';

3.ajax工具

import { ajax } from 'rxjs/ajax';

4.webSocket測試

import { webSocket } from 'rxjs/webSocket';

5.測試code

import { TestScheduler } from 'rxjs/testing';

注:按需引入Rxjs模塊,防止打包後文件過大。server

相關文章
相關標籤/搜索