t4t5/sweetalert — pull request #3 by adamterlson (2014-10-01 05:20:09+00:00)
Title: Adding promise support, with examples

Confirmation action resolves the deferred, dismissal or cancel reject.

I find this to be really nice when working with client-side async workflows. For example:

`````javascript`````
$.get('/some/endpoint')
.then(function () {
return swal({
title: "Success!",
text: "You got /some/endpoint. Want to fetch another?",
type: "success",
showCancelButton: true
});
})
.then(function () {
return $.get('/the/next/endpoint');
})
.then(goToNextPage);
`````````

Anyway, I consider promise support critical for any modal solution so I can compose messaging into my promise-based workflows!