Created
September 12, 2019 11:52
-
-
Save VinnyFonseca/1a63da1537be982ca6f0542f9f5613c9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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