From a4854735b95d249b3fd8c027fefda4d8f88eb34b Mon Sep 17 00:00:00 2001 From: Joost De Cock Date: Sat, 11 Aug 2018 14:03:06 +0200 Subject: [PATCH] :sprakles: Support for bundled hooks --- src/pattern.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pattern.js b/src/pattern.js index 4c3a8461ce1..6a429e31786 100644 --- a/src/pattern.js +++ b/src/pattern.js @@ -215,6 +215,10 @@ Pattern.prototype.loadPluginHooks = function(plugin) { for (let hook of this.hooks.all) { if (typeof plugin.hooks[hook] === "function") { this.on(hook, plugin.hooks[hook]); + } else if (typeof plugin.hooks[hook] === "array") { + for (let method of plugin.hooks[hook]) { + this.on(hook, method); + } } } };