rxjs
1. npm root 查看包安装目录
2. npm root -g
Use the npm root -g
command for find out your global npm
path.
If you are looking for the executable that npm installed, maybe because you would like to put it in your PATH, you can simply do
npm bin
or
npm bin -g
3. 查看当前项目安装的包的版本:
npm list --depth=0
The command npm root
will tell you the effective installation directory of your npm packages.
If your current working directory is a node package or a sub-directory of a node package, npm root
will tell you the local installation directory. npm root -g
will show the global installation root regardless of current working directory.
-------------------------------------------------------
import { Observable, from, of, interval } from 'rxjs'; import { filter, map, scan, take } from 'rxjs/operators'; const source = interval(1000) source.pipe(filter(val => val%2 ==0), scan((x,y)=>x+y), take(4)).subscribe(val => console.log(val));
执行结果如下:
原因分析:
https://www.jianshu.com/p/d8cb71554008