1
0
Fork 0
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:
Fred Chasen 2018-10-28 22:31:24 -07:00
parent 14af4539f5
commit 363be16fd9
11 changed files with 590 additions and 12 deletions

View file

@ -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(){...});