mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-04 15:09:16 +02:00
Add Storage
This commit is contained in:
parent
14af4539f5
commit
363be16fd9
11 changed files with 590 additions and 12 deletions
|
@ -28,6 +28,21 @@ class Hook {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a function
|
||||
* @example this.content.deregister(function(){...});
|
||||
*/
|
||||
deregister(func){
|
||||
let hook;
|
||||
for (let i = 0; i < this.hooks.length; i++) {
|
||||
hook = this.hooks[i];
|
||||
if (hook === func) {
|
||||
this.hooks.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Triggers a hook to run all functions
|
||||
* @example this.content.trigger(args).then(function(){...});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue