fragment A
const moveHandler = function() {
// do something...
}
dom.addEventListener("mousemove", function() {
window.requestAnimationFrame(moveHandler)
})
is there any difference between the two writing methods? This is the problem I encountered when dragging a dom effect