If you use rxjs to achieve a function similar to fastclick, how to write the stream interception in mousemove?

topic description

use rxjs to implement fastclick-like functions (desktop)

sources of topics and their own ideas

use canvas to make an alternative html layout. But it doesn"t make sense to simply click on canvas. I think rxjs itself is good. But it is difficult to use this thing to do this thing. Because there are two situations, one is that the click does not move, and the other is that the click movement is small.

related codes

/ / Please paste the code text below (do not replace the code with pictures)

what result do you expect? What is the error message actually seen?

observe that canvas objects use mouseDown$,mouseMove$,mouseUp$,mouseOut$ to implement streams with move less than 1px and time interval less than 500ms during the period from down to up on canvas

A general idea of ps:. The description is not very clear. There is a problem in the process of self-implementation. I"m reading a book. If you can solve it yourself, you will post your own code.

< hr >

add description

there may be a problem with the expression. There may be many elements on the canvas. So I hope to use mousedown,mousemove,mouseup to simulate a stream similar to click. So that when the movement is large, it does not trigger. Triggered when not moving or moving small.

clipboard.png

< H2 > this is what it says for the time being. < / H2 >

the distance judgment above is wrong. It should be more than the time to stop.

Dec.14,2021

fastclick is not required on the desktop side.
if you want to simulate, just listen to body's mousedown and up

Menu