Dispatcher should be a global too

This commit is contained in:
David Baker 2015-09-28 14:48:50 +01:00
parent 3be50e327d
commit 3792d5494a

View file

@ -24,10 +24,13 @@ class MatrixDispatcher extends flux.Dispatcher {
setTimeout(super.dispatch.bind(this, payload), 0);
} else {
this.dispatching = true;
super.dispatch.call(this, payload);
super.dispatch(payload);
this.dispatching = false;
}
}
};
module.exports = new MatrixDispatcher();
if (global.mxDispatcher === undefined) {
global.mxDispatcher = new MatrixDispatcher();
}
module.exports = global.mxDispatcher;