Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | 1x 1x 1x |
export class ControllerHooks {
controllers: Map<string, any> = new Map();
init() {}
setHook(name: string, target: any) {
this.controllers.set(name, target);
}
getHook(name) {
if(this.hasHook(name)) {
return this.controllers.get(name);
} else {
throw new Error('Hook not found!')
}
}
hasHook(name: string) {
return this.controllers.has(name);
}
}
export const controllerHooks = new ControllerHooks(); |