0.0.2 • Published 1 year ago

force-bind v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year 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

1 year ago

0.0.1

1 year ago