_.bind(function, object) to function.bind(object)

This commit is contained in:
djmaze 2020-07-20 15:47:33 +02:00
parent db2d95d684
commit af136f46c4
23 changed files with 38 additions and 45 deletions

View file

@ -35,7 +35,7 @@ class HtmlEditor {
this.element = element;
this.$element = $(element);
this.resize = _.throttle(_.bind(this.resizeEditor, this), 100);
this.resize = _.throttle(this.resizeEditor.bind(this), 100);
this.init();
}

View file

@ -56,7 +56,7 @@ class Selector {
this.focusedItem = koFocusedItem || ko.observable(null);
this.selectedItem = koSelectedItem || ko.observable(null);
this.itemSelectedThrottle = _.debounce(_.bind(this.itemSelected, this), 300);
this.itemSelectedThrottle = _.debounce(this.itemSelected.bind(this), 300);
this.listChecked.subscribe((items) => {
if (0 < items.length) {

View file

@ -16,12 +16,11 @@ const isFunc = _.isFunction;
const isUnd = _.isUndefined;
const isNull = _.isNull;
const has = _.has;
const bind = _.bind;
const noop = () => {}; // eslint-disable-line no-empty-function
const noopTrue = () => true;
const noopFalse = () => false;
export { trim, isArray, isObject, isFunc, isUnd, isNull, has, bind, noop, noopTrue, noopFalse, jassl };
export { trim, isArray, isObject, isFunc, isUnd, isNull, has, noop, noopTrue, noopFalse, jassl };
/**
* @param {Function} func