A Voltron plugin for adding Promise-based lifecycle hooks to any object. (Not for public use yet)
JavaScript
Switch branches/tags
Latest commit 9ddd93c Oct 1, 2013 @jmreidy 1.0.1
Permalink
Failed to load latest commit information.
test
.gitignore initial commit Oct 10, 2012
.travis.yml initial commit Oct 10, 2012
LICENSE adding MIT license Oct 26, 2012
README.md Remove non-public warning Jul 25, 2013
index.js wrong promise being returned Oct 11, 2012
package.json

README.md

Build Status

VoltronHooks allows you to add async, promise based lifecycle hooks (before/after calls) to any method that returns a promise:

  • beforeHooks are executed before a method call
  • afterHooks are executed after a method call
  • errors in before hooks prevent execution of the called method
  • beforeHooks return the original method's promise; after hooks return a promise from the hook itself

VoltronHooks are used by VoltronModels and VoltronAdapters to add methods like beforeSave, beforeUpdate, afterCreate, etc. But VoltronHooks can be applied to any object, independent of whether other Voltron components are used.