不要怂,就是干,撸起袖子干!

Commit f889d6f0 by overlookmotel

Comments on hook function signatures

1 parent 80f9a4d3
Showing with 18 additions and 18 deletions
...@@ -147,7 +147,7 @@ Hooks.addHook = function(hookType, name, fn) { ...@@ -147,7 +147,7 @@ Hooks.addHook = function(hookType, name, fn) {
/** /**
* A hook that is run before validation * A hook that is run before validation
* @param {String} name * @param {String} name
* @param {Function} fn A callback function that is called with instance, callback(err) * @param {Function} fn A callback function that is called with instance, options, callback(err)
*/ */
Hooks.beforeValidate = function(name, fn) { Hooks.beforeValidate = function(name, fn) {
return Hooks.addHook.call(this, 'beforeValidate', name, fn); return Hooks.addHook.call(this, 'beforeValidate', name, fn);
...@@ -156,7 +156,7 @@ Hooks.beforeValidate = function(name, fn) { ...@@ -156,7 +156,7 @@ Hooks.beforeValidate = function(name, fn) {
/** /**
* A hook that is run after validation * A hook that is run after validation
* @param {String} name * @param {String} name
* @param {Function} fn A callback function that is called with instance, callback(err) * @param {Function} fn A callback function that is called with instance, options, callback(err)
*/ */
Hooks.afterValidate = function(name, fn) { Hooks.afterValidate = function(name, fn) {
return Hooks.addHook.call(this, 'afterValidate', name, fn); return Hooks.addHook.call(this, 'afterValidate', name, fn);
...@@ -165,7 +165,7 @@ Hooks.afterValidate = function(name, fn) { ...@@ -165,7 +165,7 @@ Hooks.afterValidate = function(name, fn) {
/** /**
* A hook that is run before creating a single instance * A hook that is run before creating a single instance
* @param {String} name * @param {String} name
* @param {Function} fn A callback function that is called with attributes, callback(err) * @param {Function} fn A callback function that is called with attributes, options, callback(err)
*/ */
Hooks.beforeCreate = function(name, fn) { Hooks.beforeCreate = function(name, fn) {
return Hooks.addHook.call(this, 'beforeCreate', name, fn); return Hooks.addHook.call(this, 'beforeCreate', name, fn);
...@@ -174,7 +174,7 @@ Hooks.beforeCreate = function(name, fn) { ...@@ -174,7 +174,7 @@ Hooks.beforeCreate = function(name, fn) {
/** /**
* A hook that is run after creating a single instance * A hook that is run after creating a single instance
* @param {String} name * @param {String} name
* @param {Function} fn A callback function that is called with attributes, callback(err) * @param {Function} fn A callback function that is called with attributes, options, callback(err)
*/ */
Hooks.afterCreate = function(name, fn) { Hooks.afterCreate = function(name, fn) {
return Hooks.addHook.call(this, 'afterCreate', name, fn); return Hooks.addHook.call(this, 'afterCreate', name, fn);
...@@ -183,7 +183,7 @@ Hooks.afterCreate = function(name, fn) { ...@@ -183,7 +183,7 @@ Hooks.afterCreate = function(name, fn) {
/** /**
* A hook that is run before destroying a single instance * A hook that is run before destroying a single instance
* @param {String} name * @param {String} name
* @param {Function} fn A callback function that is called with instance, callback(err) * @param {Function} fn A callback function that is called with instance, options, callback(err)
* *
* @alias beforeDelete * @alias beforeDelete
*/ */
...@@ -198,7 +198,7 @@ Hooks.beforeDelete = function(name, fn) { ...@@ -198,7 +198,7 @@ Hooks.beforeDelete = function(name, fn) {
/** /**
* A hook that is run after destroying a single instance * A hook that is run after destroying a single instance
* @param {String} name * @param {String} name
* @param {Function} fn A callback function that is called with instance, callback(err) * @param {Function} fn A callback function that is called with instance, options, callback(err)
* *
* @alias afterDelete * @alias afterDelete
*/ */
...@@ -213,7 +213,7 @@ Hooks.afterDelete = function(name, fn) { ...@@ -213,7 +213,7 @@ Hooks.afterDelete = function(name, fn) {
/** /**
* A hook that is run before updating a single instance * A hook that is run before updating a single instance
* @param {String} name * @param {String} name
* @param {Function} fn A callback function that is called with instance, callback(err) * @param {Function} fn A callback function that is called with instance, options, callback(err)
*/ */
Hooks.beforeUpdate = function(name, fn) { Hooks.beforeUpdate = function(name, fn) {
return Hooks.addHook.call(this, 'beforeUpdate', name, fn); return Hooks.addHook.call(this, 'beforeUpdate', name, fn);
...@@ -222,7 +222,7 @@ Hooks.beforeUpdate = function(name, fn) { ...@@ -222,7 +222,7 @@ Hooks.beforeUpdate = function(name, fn) {
/** /**
* A hook that is run after updating a single instance * A hook that is run after updating a single instance
* @param {String} name * @param {String} name
* @param {Function} fn A callback function that is called with instance, callback(err) * @param {Function} fn A callback function that is called with instance, options, callback(err)
*/ */
Hooks.afterUpdate = function(name, fn) { Hooks.afterUpdate = function(name, fn) {
return Hooks.addHook.call(this, 'afterUpdate', name, fn); return Hooks.addHook.call(this, 'afterUpdate', name, fn);
...@@ -231,7 +231,7 @@ Hooks.afterUpdate = function(name, fn) { ...@@ -231,7 +231,7 @@ Hooks.afterUpdate = function(name, fn) {
/** /**
* A hook that is run before creating instances in bulk * A hook that is run before creating instances in bulk
* @param {String} name * @param {String} name
* @param {Function} fn A callback function that is called with instances, fields, callback(err) * @param {Function} fn A callback function that is called with instances, options, callback(err)
*/ */
Hooks.beforeBulkCreate = function(name, fn) { Hooks.beforeBulkCreate = function(name, fn) {
return Hooks.addHook.call(this, 'beforeBulkCreate', name, fn); return Hooks.addHook.call(this, 'beforeBulkCreate', name, fn);
...@@ -240,16 +240,16 @@ Hooks.beforeBulkCreate = function(name, fn) { ...@@ -240,16 +240,16 @@ Hooks.beforeBulkCreate = function(name, fn) {
/** /**
* A hook that is run after creating instances in bulk * A hook that is run after creating instances in bulk
* @param {String} name * @param {String} name
* @param {Function} fn A callback function that is called with instances, fields, callback(err) * @param {Function} fn A callback function that is called with instances, options, callback(err)
*/ */
Hooks.afterBulkCreate = function(name, fn) { Hooks.afterBulkCreate = function(name, fn) {
return Hooks.addHook.call(this, 'afterBulkCreate', name, fn); return Hooks.addHook.call(this, 'afterBulkCreate', name, fn);
}; };
/** /**
* A hook that is run before destroing instances in bulk * A hook that is run before destroying instances in bulk
* @param {String} name * @param {String} name
* @param {Function} fn A callback function that is called with where, callback(err) * @param {Function} fn A callback function that is called with options, callback(err)
* *
* @alias beforeBulkDelete * @alias beforeBulkDelete
*/ */
...@@ -264,7 +264,7 @@ Hooks.beforeBulkDelete = function(name, fn) { ...@@ -264,7 +264,7 @@ Hooks.beforeBulkDelete = function(name, fn) {
/** /**
* A hook that is run after destroying instances in bulk * A hook that is run after destroying instances in bulk
* @param {String} name * @param {String} name
* @param {Function} fn A callback function that is called with where, callback(err) * @param {Function} fn A callback function that is called with options, callback(err)
* *
* @alias afterBulkDelete * @alias afterBulkDelete
*/ */
...@@ -279,7 +279,7 @@ Hooks.afterBulkDelete = function(name, fn) { ...@@ -279,7 +279,7 @@ Hooks.afterBulkDelete = function(name, fn) {
/** /**
* A hook that is run after updating instances in bulk * A hook that is run after updating instances in bulk
* @param {String} name * @param {String} name
* @param {Function} fn A callback function that is called with attribute, where, callback(err) * @param {Function} fn A callback function that is called with options, callback(err)
*/ */
Hooks.beforeBulkUpdate = function(name, fn) { Hooks.beforeBulkUpdate = function(name, fn) {
return Hooks.addHook.call(this, 'beforeBulkUpdate', name, fn); return Hooks.addHook.call(this, 'beforeBulkUpdate', name, fn);
...@@ -288,7 +288,7 @@ Hooks.beforeBulkUpdate = function(name, fn) { ...@@ -288,7 +288,7 @@ Hooks.beforeBulkUpdate = function(name, fn) {
/** /**
* A hook that is run after updating instances in bulk * A hook that is run after updating instances in bulk
* @param {String} name * @param {String} name
* @param {Function} fn A callback function that is called with attribute, where, callback(err) * @param {Function} fn A callback function that is called with options, callback(err)
*/ */
Hooks.afterBulkUpdate = function(name, fn) { Hooks.afterBulkUpdate = function(name, fn) {
return Hooks.addHook.call(this, 'afterBulkUpdate', name, fn); return Hooks.addHook.call(this, 'afterBulkUpdate', name, fn);
...@@ -297,7 +297,7 @@ Hooks.afterBulkUpdate = function(name, fn) { ...@@ -297,7 +297,7 @@ Hooks.afterBulkUpdate = function(name, fn) {
/** /**
* A hook that is run before a find (select) query * A hook that is run before a find (select) query
* @param {String} name * @param {String} name
* @param {Function} fn A callback function that is called with attribute, where, callback(err) * @param {Function} fn A callback function that is called with options, callback(err)
*/ */
Hooks.beforeFind = function(name, fn) { Hooks.beforeFind = function(name, fn) {
return Hooks.addHook.call(this, 'beforeFind', name, fn); return Hooks.addHook.call(this, 'beforeFind', name, fn);
...@@ -306,7 +306,7 @@ Hooks.beforeFind = function(name, fn) { ...@@ -306,7 +306,7 @@ Hooks.beforeFind = function(name, fn) {
/** /**
* A hook that is run before a find (select) query, after any { include: {all: ...} } options are expanded * A hook that is run before a find (select) query, after any { include: {all: ...} } options are expanded
* @param {String} name * @param {String} name
* @param {Function} fn A callback function that is called with attribute, where, callback(err) * @param {Function} fn A callback function that is called with options, callback(err)
*/ */
Hooks.beforeFindAfterExpandIncludeAll = function(name, fn) { Hooks.beforeFindAfterExpandIncludeAll = function(name, fn) {
return Hooks.addHook.call(this, 'beforeFindAfterExpandIncludeAll', name, fn); return Hooks.addHook.call(this, 'beforeFindAfterExpandIncludeAll', name, fn);
...@@ -315,7 +315,7 @@ Hooks.beforeFindAfterExpandIncludeAll = function(name, fn) { ...@@ -315,7 +315,7 @@ Hooks.beforeFindAfterExpandIncludeAll = function(name, fn) {
/** /**
* A hook that is run after a find (select) query * A hook that is run after a find (select) query
* @param {String} name * @param {String} name
* @param {Function} fn A callback function that is called with attribute, where, callback(err) * @param {Function} fn A callback function that is called with instance(s), options, callback(err)
*/ */
Hooks.afterFind = function(name, fn) { Hooks.afterFind = function(name, fn) {
return Hooks.addHook.call(this, 'afterFind', name, fn); return Hooks.addHook.call(this, 'afterFind', name, fn);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!