Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
const wasTouched = () => {
myFrameworkOfChoice.dispatchEvent('USER_HAS_TOUCHED', true);
window.removeEventListener('touchstart', wasTouched, false);
window.addEventListener('mousedown', wasClicked, false);
};
const wasClicked = () => {
myFrameworkOfChoice.dispatchEvent('USER_HAS_TOUCHED', false);
window.removeEventListener('mousedown', wasClicked, false);
window.addEventListener('touchstart', wasTouched, false);
};
window.addEventListener('touchstart', wasTouched, false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.