如何在 Rx Js observables 中通过简单的解决方案更改多过滤器运算符?
我想用相对较短的代码编写这段代码,你能建议一些解决方案吗? 谢谢!
fromEvent(document, 'click').pipe(
filter(e => e.target !== this.one.nativeElement),
filter(e => e.target !== this.two.nativeElement),
filter(e => e.target !== this.three.nativeElement),
map(() => console.log('target'))
.subscribe();
I want to write this code with a relatively short code, can you advise some solution?
Thanks!
fromEvent(document, 'click').pipe(
filter(e => e.target !== this.one.nativeElement),
filter(e => e.target !== this.two.nativeElement),
filter(e => e.target !== this.three.nativeElement),
map(() => console.log('target'))
.subscribe();
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)