mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 21:19:21 +03:00
Remove addHook/runHook system as it is never used
This commit is contained in:
parent
996723a486
commit
d88855ebd9
7 changed files with 1 additions and 128 deletions
|
|
@ -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 {?}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue