它接受一个可观察到的参数windowboundaries,并在给定windowboundaries发出时返回一个嵌套的observable。
语法
window(windowBoundaries: Observable): Observable
参量
windowBoundaries – 参数windowboundaries是可观察的。
返回值
它返回一个可观察的窗口。
例
import { fromEvent, interval } from 'rxjs'; import { window } from 'rxjs/operators'; let btncick = fromEvent(document, 'click'); let sec = interval(5000); let result = btncick.pipe(window(interval(5000))); result.subscribe(x => console.log(x));
作者:terry,如若转载,请注明出处:https://www.web176.com/rxjs/1850.html