Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

pass data to afterhooks, too #386

Open
wants to merge 1 commit into from

2 participants

@ktmud

see #385

@1602
Owner

It only makes sense for validations before saving (such as afterValidate), but for all other it will be misleading. Could you please take that into account?

@ktmud

For afterSave, people can receive data for some kind of double check (though they may never need it). Setting up a new limitation doesn't bring much good, meanwhile introduced more complexity, and broke the consistency.

BTW, is it possible to rewrite the hook mechanism with hooks-js or something? Currently, adding multiple handler on one hook is painful.

@1602
Owner

Let's leave standardization with breaking changes to major release. This argument was introduced after hooks was implemented, to get proof of traction before making any breaking changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 2, 2014
  1. @ktmud

    pass data to afterhooks, too

    ktmud authored
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/hooks.js
View
2  lib/hooks.js
@@ -56,7 +56,7 @@ Hookable.prototype.trigger = function trigger(actionName, work, data, quit) {
function next(done) {
if (afterHook) {
- afterHook.call(inst, done);
+ afterHook.call(inst, done, data);
} else if (done) {
done.call(this);
}
Something went wrong with that request. Please try again.