为什么我们在下面的代码中使用两个过滤器而不是一个?
fromEvent<MouseEvent>(this.mapElement, "click")
.pipe(
filter(e => !this.props.disableEvents),
filter(_ => !this.mouseState.moved && mouseDownInMap)
)
.subscribe(e => {});
为什么不:
fromEvent<MouseEvent>(this.mapElement, "click")
.pipe(filter( e => !this.props.disableEvents && !this.mouseState.moved && mouseDownInMap))
.subscribe(e => {});
另外,如果.pipe()
也可以在没有管道的情况下使用,为什么呢?
可以