Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function setupLocalDataTrack() {
const dataTrack = new LocalDataTrack();
let mouseDown;
let mouseCoordinates;
window.addEventListener('mousedown', () => {
mouseDown = true;
}, false);
window.addEventListener('mouseup', () => {
mouseDown = false;
}, false);
window.addEventListener('mousemove', event => {
const { pageX: x, pageY: y } = event;
mouseCoordinates = { x, y };