Hook

addHook(`hookType`, fn, name)

addHook

Parameters:
  • `hookType`
    • Type: string
    • see ./hookType.js for available types

  • fn
    • Type: function
    • hook function

  • name
    • Type: string
    • the identificator

Returns: this
afterCreate(hookType, fn, name)this

adds hook function to the stack

Parameters:
  • hookType
    • Type: string
    • see ./hookType.js for available types

  • fn
    • Type: function
    • hook function

  • name
    • Type: string
    • the identificator

Returns: this
afterDestroy(hookType, fn, name)this

adds hook function to the stack

Parameters:
  • hookType
    • Type: string
    • see ./hookType.js for available types

  • fn
    • Type: function
    • hook function

  • name
    • Type: string
    • the identificator

Returns: this
afterFailedIndexRemoval(hookType, fn, name)this

adds hook function to the stack

Parameters:
  • hookType
    • Type: string
    • see ./hookType.js for available types

  • fn
    • Type: function
    • hook function

  • name
    • Type: string
    • the identificator

Returns: this
afterFailedRollback(hookType, fn, name)this

adds hook function to the stack

Parameters:
  • hookType
    • Type: string
    • see ./hookType.js for available types

  • fn
    • Type: function
    • hook function

  • name
    • Type: string
    • the identificator

Returns: this
afterGet(hookType, fn, name)this

adds hook function to the stack

Parameters:
  • hookType
    • Type: string
    • see ./hookType.js for available types

  • fn
    • Type: function
    • hook function

  • name
    • Type: string
    • the identificator

Returns: this
afterRollback(hookType, fn, name)this

adds hook function to the stack

Parameters:
  • hookType
    • Type: string
    • see ./hookType.js for available types

  • fn
    • Type: function
    • hook function

  • name
    • Type: string
    • the identificator

Returns: this
afterUpdate(hookType, fn, name)this

adds hook function to the stack

Parameters:
  • hookType
    • Type: string
    • see ./hookType.js for available types

  • fn
    • Type: function
    • hook function

  • name
    • Type: string
    • the identificator

Returns: this
afterValidate(hookType, fn, name)this

adds hook function to the stack

Parameters:
  • hookType
    • Type: string
    • see ./hookType.js for available types

  • fn
    • Type: function
    • hook function

  • name
    • Type: string
    • the identificator

Returns: this
beforeCreate(hookType, fn, name)this

adds hook function to the stack

Parameters:
  • hookType
    • Type: string
    • see ./hookType.js for available types

  • fn
    • Type: function
    • hook function

  • name
    • Type: string
    • the identificator

Returns: this
beforeDestroy(hookType, fn, name)this

adds hook function to the stack

Parameters:
  • hookType
    • Type: string
    • see ./hookType.js for available types

  • fn
    • Type: function
    • hook function

  • name
    • Type: string
    • the identificator

Returns: this
beforeGet(hookType, fn, name)this

adds hook function to the stack

Parameters:
  • hookType
    • Type: string
    • see ./hookType.js for available types

  • fn
    • Type: function
    • hook function

  • name
    • Type: string
    • the identificator

Returns: this
beforeRollback(hookType, fn, name)this

adds hook function to the stack

Parameters:
  • hookType
    • Type: string
    • see ./hookType.js for available types

  • fn
    • Type: function
    • hook function

  • name
    • Type: string
    • the identificator

Returns: this
beforeUpdate(hookType, fn, name)this

adds hook function to the stack

Parameters:
  • hookType
    • Type: string
    • see ./hookType.js for available types

  • fn
    • Type: function
    • hook function

  • name
    • Type: string
    • the identificator

Returns: this
beforeValidate(hookType, fn, name)this

adds hook function to the stack

Parameters:
  • hookType
    • Type: string
    • see ./hookType.js for available types

  • fn
    • Type: function
    • hook function

  • name
    • Type: string
    • the identificator

Returns: this
beforeValidate(hookType, fn, name)this

adds hook function to the stack

Parameters:
  • hookType
    • Type: string
    • see ./hookType.js for available types

  • fn
    • Type: function
    • hook function

  • name
    • Type: string
    • the identificator

Returns: this
removeHook(hookType, name)

removeHook

Parameters:
  • hookType
    • Type: string
    • see ./hookType.js for available types

  • name
    • Type: string
    • the identificator

Returns: this
runHooks(hookType)

runHooks

additional arguments passed to the function will be passed to the hook function

Parameters:
  • hookType
    • Type: string or Object
Returns: Promise
comments powered by Disqus