0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00
ghost/core/client/app/utils/bind.js

14 lines
278 B
JavaScript
Raw Normal View History

const {slice} = Array.prototype;
export default function (/* func, args, thisArg */) {
let args = slice.call(arguments);
let func = args.shift();
let thisArg = args.pop();
function bound() {
return func.apply(thisArg, args);
}
return bound;
}