FuruholmAnton
12/1/2017 - 8:36 PM

bind.js

/**
 * Bind methods
 * ex. bind(this, 'onClick', 'setHeight');
 *
 * @param {Object} self
 * @param {string} functions
 */
function bind(self, ...functions) {
	functions.forEach((name) => {
		self[name] = self[name].bind(self);
	})
}