Created
September 21, 2018 19:29
-
-
Save ghazaltaimur13/9d3305b58908bd5995431e541bcbf456 to your computer and use it in GitHub Desktop.
Add your own custom mixin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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