WIP reworking of skinning and app integration process

This commit is contained in:
David Baker 2015-09-11 15:42:11 +01:00
parent 9b73d6ed6d
commit f3b9f8c799
4 changed files with 105 additions and 15 deletions

View file

@ -17,21 +17,17 @@ limitations under the License.
'use strict';
var flux = require("flux");
var extend = require("./extend");
var MatrixDispatcher = function() {
flux.Dispatcher.call(this);
class MatrixDispatcher extends flux.Dispatcher {
dispatch(payload) {
if (this.dispatching) {
setTimeout(super.dispatch.bind(this, payload), 0);
} else {
this.dispatching = true;
super.dispatch.call(this, payload);
this.dispatching = false;
}
}
};
extend(MatrixDispatcher.prototype, flux.Dispatcher.prototype);
MatrixDispatcher.prototype.dispatch = function(payload) {
if (this.dispatching) {
setTimeout(flux.Dispatcher.prototype.dispatch.bind(this, payload), 0);
} else {
this.dispatching = true;
flux.Dispatcher.prototype.dispatch.call(this, payload);
this.dispatching = false;
}
}
module.exports = new MatrixDispatcher();