Learn more  » Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Bower components Debian packages RPM packages NuGet packages

skava / chain-able-lego   js

Repository URL to install this package:

Version: 6.0.4 

/ src / wrap / wrapBeforeAfter.ts

// const {curry, pipe} = require('../../exportsMiddleman')
// // @NOTE need to `flip` for usage as a decorator
// function _before(original, extraBehavior) {
//   return function() {
//     extraBehavior.apply(this, arguments)
//     return original.apply(this, arguments)
//   }
// }
// function _after(original, extraBehavior) {
//   return function() {
//     const returnValue = original.apply(this, arguments)
//     extraBehavior.apply(this, arguments)
//     return returnValue
//   }
// }
// // @TODO
// function tapReturn(original, extraBehavior) {}
// function tapArgs(original, extraBehavior) {}
// // const pipeN = n => curry(n, pipe)
// const before = curry(2, _before)
// const after = curry(2, _after)
// module.exports = {before, after}