0.0.2 • Published 2 years ago

force-bind v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

force-bind

Do not use this library it was made as a joke

import { forceBind } from "force-bind";

const arrowFn = (a) => a + this.b;
const thisCtx = {
    b: 2,
};

const boundArrowFn = forceBind(arrowFn, thisCtx);

boundArrowFn(1); // returns 3
0.0.2

2 years ago

0.0.1

2 years ago