Adding promise cancel
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();
Showing
Please register or sign in to comment