Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function not calling when timer ends #14

Open
jerocosio opened this issue Jun 1, 2015 · 1 comment
Open

Function not calling when timer ends #14

jerocosio opened this issue Jun 1, 2015 · 1 comment

Comments

@jerocosio
Copy link

Hi, I don't know if it's the version of sweet alert or something else, but unfortunately the function that should be called when the timer ends right now is not working. :s

swal({   
                    title: "¡Listo!",   
                    text: "Ya está la dirección de envío.",   
                    type: "success",
                    timer: 1000,   
                    showConfirmButton: false},   
                    function(){  
                       console.log('done');
                    }
                    );
@mumairofficial
Copy link

mumairofficial commented May 16, 2016

var swalPromise = function() {
  return new Promise(function(resolve, reject){
    swal({
        title: "Configuration Successful",
        text: "text",
        timer: 2000,
        showConfirmButton: false
    });
    resolve(true);
  });
}

swalPromise().then(function(resolve){
  console.log(resolve)
  if(resolve) {
    console.log("Hello World");
  }
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants