🚧 Linting and prettier code style
This commit is contained in:
parent
1f10829426
commit
568d0cdc4d
14 changed files with 3395 additions and 335 deletions
21
src/hooks.js
21
src/hooks.js
|
@ -1,22 +1,19 @@
|
|||
export default function hooks ()
|
||||
{
|
||||
export default function hooks() {
|
||||
this._hooks = {};
|
||||
this.all = ['preRenderSvg', 'postRenderSvg', 'insertText'];
|
||||
this.all = ["preRenderSvg", "postRenderSvg", "insertText"];
|
||||
|
||||
this.prototype.list = function (hook)
|
||||
{
|
||||
if(typeof this._hooks[hook] === 'undefined') {
|
||||
this.prototype.list = function(hook) {
|
||||
if (typeof this._hooks[hook] === "undefined") {
|
||||
return false;
|
||||
}
|
||||
|
||||
return this._hooks[hook];
|
||||
}
|
||||
};
|
||||
|
||||
this.prototype.attach = function (hook, obj)
|
||||
{
|
||||
if(typeof this._hooks[hook] === 'undefined') return;
|
||||
for(let func of this._hooks[hook]) {
|
||||
this.prototype.attach = function(hook, obj) {
|
||||
if (typeof this._hooks[hook] === "undefined") return;
|
||||
for (let func of this._hooks[hook]) {
|
||||
obj.pre(hook, func);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue