I am trying to perform hooks operations http://docs.strongloop.com/display/public/LB/Operation+hooks
Here is what I did in the application code:
mymodel.observe('before save', doSomething);
mymodel.observe('before save', doSomethingElse);
var doSomething = function (ctx, next) {
next();
};
var doSomethingElse = function (ctx, next) {
next();
};
When I test this code, I find that doSomething always executes, which makes me wonder if the observer function can only register once per model or is this an error?
If this is by design, could you tell us the reason for this?
source
share