react-images-lightbox
Version:
A simple, responsive lightbox component for displaying an array of images with React.js
16 lines (12 loc) • 297 B
JavaScript
/**
Bind multiple component methods:
* @param {this} context
* @param {Array} functions
constructor() {
...
bindFunctions.call(this, ['handleClick', 'handleOther']);
}
*/
module.exports = function bindFunctions (functions) {
functions.forEach(f => (this[f] = this[f].bind(this)));
};