Commit b715d066 authored by Romain Courteaud's avatar Romain Courteaud

Release version 0.28.0

parent dcc1c854
Pipeline #25770 passed with stage
in 0 seconds
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -992,19 +992,32 @@ if (typeof document.contains !== 'function') {
this._latest_promise = null;
};
function doNothing() {
return;
}
Mutex.prototype = {
constructor: Mutex,
lockAndRun: function lockMutexAndRun(callback) {
var previous_promise = this._latest_promise;
var previous_promise = this._latest_promise,
returned_promise;
if (previous_promise === null) {
this._latest_promise = RSVP.resolve(callback());
} else {
this._latest_promise = this._latest_promise
return this._latest_promise;
}
returned_promise = previous_promise
.always(function () {
return callback();
});
}
return this._latest_promise;
// Do not return latest promise, to not allow external caller
// to explicitely cancel it,
// ie, ensure next promise is triggered only when ALL previous
// promised are finished (not only the single previous one)
this._latest_promise = RSVP.all([
previous_promise.always(doNothing),
returned_promise.always(doNothing)
]);
return returned_promise;
}
};
......
{
"name": "renderjs",
"version": "0.27.0",
"version": "0.28.0",
"description": "RenderJs provides HTML5 gadgets",
"main": "dist/renderjs-latest.js",
"dependencies": {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment