Created
September 6, 2017 14:30
-
-
Save t4t5/730b44e10c7b56b26e86c1db534827e6 to your computer and use it in GitHub Desktop.
Using async with SweetAlert
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 deleteFile = async () => { | |
// Wait for the user to press a button... | |
const shouldDelete = await swal("Delete file?", "Are you sure that you want to delete this file?", "warning"); | |
if (shouldDelete) { | |
// Code to actually delete file goes here | |
swal("Poof!", "Your file has been deleted!", "success"); | |
} | |
} |
talha08
commented
Nov 24, 2019
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment