Repositorio del curso CCOM4030 el semestre B91 del proyecto Artesanías con el Instituto de Cultura

mixin.js 577B

123456789101112131415161718
  1. define(['./_setup', './underscore', './_chainResult', './each', './functions'], function (_setup, underscore, _chainResult, each, functions) {
  2. // Add your own custom functions to the Underscore object.
  3. function mixin(obj) {
  4. each(functions(obj), function(name) {
  5. var func = underscore[name] = obj[name];
  6. underscore.prototype[name] = function() {
  7. var args = [this._wrapped];
  8. _setup.push.apply(args, arguments);
  9. return _chainResult(this, func.apply(underscore, args));
  10. };
  11. });
  12. return underscore;
  13. }
  14. return mixin;
  15. });