title: How to listen for when sweet alert closes
body: <p>I am currently working with sweetalert2 and I am trying to detect when the alert closes. However the DeleteUnsavedImages function is not firing. I thought that assigning the function to the onclose key would work but no luck.</p>
  
  <pre><code>   swal({
         html: data,
         showCloseButton: false,
         showCancelButton: false,
         width: 800,
         showConfirmButton: false,
         onClose: DeleteUnsavedImages()
     }).then(function () {
  
     });
  
  
  function DeleteUnsavedImages(){
      var test = "-1";
  }
  </code></pre>
  
  <p>Any help would be appreciated :-)</p>