Remove addHook/runHook system as it is never used

This commit is contained in:
djmaze 2020-08-22 01:04:15 +02:00
parent 996723a486
commit d88855ebd9
7 changed files with 1 additions and 128 deletions

View file

@ -1,36 +1,9 @@
import { data as GlobalsData } from 'Common/Globals';
import * as Settings from 'Storage/Settings';
const SIMPLE_HOOKS = {},
USER_VIEW_MODELS_HOOKS = [],
const USER_VIEW_MODELS_HOOKS = [],
ADMIN_VIEW_MODELS_HOOKS = [];
/**
* @param {string} name
* @param {Function} callback
*/
export function addHook(name, callback) {
if (typeof callback === 'function') {
if (!Array.isArray(SIMPLE_HOOKS[name])) {
SIMPLE_HOOKS[name] = [];
}
SIMPLE_HOOKS[name].push(callback);
}
}
/**
* @param {string} name
* @param {Array=} args = []
*/
export function runHook(name, args = []) {
if (Array.isArray(SIMPLE_HOOKS[name])) {
SIMPLE_HOOKS[name].forEach(callback => {
callback(...args);
});
}
}
/**
* @param {string} name
* @returns {?}