• Romain Courteaud's avatar
    Adding promise cancel · f8ce66af
    Romain Courteaud authored
    Cancel allow to manually interrupt a promise execution.
    The promise becomes rejected with a CancellationError.
    
    var xhr, promise;
    promise = RSVP.Promise(
      // Resolver function
      function (done, fail) {
        xhr = new XMLHttpRequest();
        xhr.open("GET", url);
        xhr.send();
      },
      // Canceller function
      function () {
        xhr.abort();
      },
    )
    promise.cancel();
    f8ce66af
Name
Last commit
Last update
..
rsvp Loading commit data...
rsvp.js Loading commit data...