Skip to content

Instantly share code, notes, and snippets.

@ghazaltaimur13
Created September 21, 2018 19:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ghazaltaimur13/9d3305b58908bd5995431e541bcbf456 to your computer and use it in GitHub Desktop.
Save ghazaltaimur13/9d3305b58908bd5995431e541bcbf456 to your computer and use it in GitHub Desktop.
Add your own custom mixin
'use strict';
module.exports = function(Model, options) {
Model.observe('before save', addConsoleLog);
};
let addConsoleLog = function(ctx, next) {
if (ctx.instance) {
console.log("Model instance is", ctx.instance);
}
next();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment