|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
543 bytes
|
| Line | |
|---|
| 1 | import _ from './underscore.js';
|
|---|
| 2 | import each from './each.js';
|
|---|
| 3 | import functions from './functions.js';
|
|---|
| 4 | import { push } from './_setup.js';
|
|---|
| 5 | import chainResult from './_chainResult.js';
|
|---|
| 6 |
|
|---|
| 7 | // Add your own custom functions to the Underscore object.
|
|---|
| 8 | export default function mixin(obj) {
|
|---|
| 9 | each(functions(obj), function(name) {
|
|---|
| 10 | var func = _[name] = obj[name];
|
|---|
| 11 | _.prototype[name] = function() {
|
|---|
| 12 | var args = [this._wrapped];
|
|---|
| 13 | push.apply(args, arguments);
|
|---|
| 14 | return chainResult(this, func.apply(_, args));
|
|---|
| 15 | };
|
|---|
| 16 | });
|
|---|
| 17 | return _;
|
|---|
| 18 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.