title: SweetAlert doesn't wait
body: <p>I use swal within ajax, but swal do not wait until you make the request, here is my code:</p>
  
  <pre><code>$("#btnSubmit").click(function() {
      var data = $("#myForm").serialize();
  
      $.ajax({
          type: "POST",
          url: myURL,
          data: data,
          success: function(response) {
              swal({
                  title: "Success",
                  text: "Data added.",
                  icon: "success"
              })
                  .then(() =&gt; {
                      window.location.replace(referrer);
                  });
  
          }
      });
  });
  </code></pre>