Open guzon56 opened 3 years ago
Seneca.wrap could do this by adding a wrapper pattern to each existing pattern.
However, if your function is "pure" the easiest solution is to use an ordinary utility function that returns the actual action function:
function add_foo(action) {
return function(msg, reply) {
msg.foo = 'bar'
return action(msg, reply)
}
}
seneca.add('my:pattern', add_foo(my_action))
Making this easier as a convenience is noted as a feature for the next release! Thank you
Hi, I am doing an educational project for myself to explorer microservices. I have to say that seneca is very nice solution but I came to an issue which is: I have several plugins in on of the services and I want for all plugins and patterns to write a single function that will run before each pattern, but I couldn't find a way.
is it possible? if do... how? Thanks, Harel Grozinger.