mk-react-images
Version:
A simple, responsive lightbox component for displaying an array of images with React.js
25 lines (20 loc) • 434 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = bindFunctions;
/**
Bind multiple component methods:
* @param {this} context
* @param {Array} functions
constructor() {
...
bindFunctions.call(this, ['handleClick', 'handleOther']);
}
*/
function bindFunctions(functions) {
var _this = this;
functions.forEach(function (f) {
return _this[f] = _this[f].bind(_this);
});
};