避免可观察的DOM监听器

huangapple 未分类评论51阅读模式
英文:

Avoid observable dom listener

问题

我正在尝试使用http://reactivex.io/来构建一个JAVA应用程序。

关于io.reactivex.Observable;

我有两个Observables,其中一个是复选框更改事件类型,另一个是mousemove以捕获坐标。

我希望将这两个Observables合并为一个Observable,然后调用subscribe来记录坐标(已完成)。

我的问题是,我希望在复选框被选中后再添加mousemove Observable的DOM侦听器。

我该如何使用Observable操作符来处理这个问题?

谢谢!

英文:

im trying to build an app with http://reactivex.io/ in JAVA

regarding io.reactivex.Observable;

I have two observables, one of them is a checkbox change event type and the other is a mousemove to capture the cordinates.

I want to combine those two in one observable and then call the subscribe to log the cordinates (done).

My problem is, I would like to wait to the checkbox to be checked in order to add the dom listener of the mousemove observable.

How can i handle this with the observable operators?

Thanks!

huangapple
  • 本文由 发表于 2020年5月5日 01:40:44
  • 转载请务必保留本文链接:https://java.coder-hub.com/61598341.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定