1602 / jugglingdb

Multi-database ORM for nodejs: redis, mongodb, mysql, sqlite3, postgresql, arango, in-memory...
http://1602.github.io/jugglingdb/
2.05k stars 241 forks source link

pass data to afterhooks, too #386

Open ktmud opened 10 years ago

ktmud commented 10 years ago

see #385

1602 commented 10 years ago

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 commented 10 years ago

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 commented 10 years ago

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.