mirror of https://github.com/vizality/vizality
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
635 B
25 lines
635 B
import { log, warn, error } from '@vizality/util/logger';
|
|
|
|
/**
|
|
*
|
|
*/
|
|
|
|
import { FluxDispatcher } from '@vizality/webpack';
|
|
|
|
export const labels = [ 'Global' ];
|
|
|
|
export default main => {
|
|
const ogDispatch = FluxDispatcher.dispatch;
|
|
try {
|
|
FluxDispatcher.dispatch = function (args) {
|
|
if (vizality.settings.get('fluxDispatcherLogs', false)) {
|
|
vizality.log(vizality._labels.concat('Dispatcher'), args);
|
|
}
|
|
this.wait(() => this._dispatch(args));
|
|
};
|
|
} catch (err) {
|
|
return main.error(main._labels.concat(labels.concat('Dispatcher')), err);
|
|
}
|
|
return () => FluxDispatcher.dispatch = ogDispatch;
|
|
};
|