diff --git a/lib/hooks.js b/lib/hooks.js index f3c45550..db946844 100644 --- a/lib/hooks.js +++ b/lib/hooks.js @@ -36,7 +36,17 @@ Hookable.afterUpdate = null; Hookable.beforeDestroy = null; Hookable.afterDestroy = null; -// TODO: Evaluate https://github.com/bnoguchi/hooks-js/ +/** + * @deprecated + * Setup a Model-based hook to trigger when the specified action occurs. + * The trigger is broken up into three segments: `beforeHook`, `work` and + * `afterHook`. + * @param {string} actionName The name of the action that triggers the hook. + * @param {Function} work The 2nd phase of the trigger. + * @param {*} data The value(s) to provide to the 1st phase (`beforeHook`) call. + * @callback + * @param {Function} callback + */ Hookable.prototype.trigger = function trigger(actionName, work, data, callback) { var capitalizedName = capitalize(actionName); var beforeHook = this.constructor['before' + capitalizedName] ||