fromEvent<any>(this.ele, 'mousewheel')
.pipe(debounceTime(500))
虽然是500ms内执行一次,但是执行时却要等500ms后执行,怎么做到立即执行,放弃掉后续500ms的事件
fromEvent<any>(this.ele, 'mousewheel')
.pipe(debounceTime(500))
虽然是500ms内执行一次,但是执行时却要等500ms后执行,怎么做到立即执行,放弃掉后续500ms的事件
你想要的应该是throttle而不是debounce