Created
June 16, 2019 06:37
-
-
Save ranwahle/f838ca53048d34d8bda3ddb7e97ee996 to your computer and use it in GitHub Desktop.
Confirm Exit guard
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 confirmExit = async () => { | |
const confirmModal = document.createElement('confirm-modal'); | |
confirmModal.comfirmQuestion = 'Are you sure?'; | |
document.body.appendChild(confirmModal); | |
const result = await confirmModal.getUserResult(); | |
document.body.removeChild(confirmModal); | |
return result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment