deko-bind
bind decorator for deko.
const deko = const bind = { } { return 'hello world' } static return bind { console } const worldClass = const onclicked = worldClassonclicked // Yay it's bound!!!
Installation
npm install deko-bind
Benchmarks
Comparing manually binding vs. binding with deko vs. binding with auto-bind.
# manual binding (this.foo = this.foo.bind(this) 1000000 times
ok ~24 ms (0 s + 23595643 ns)
# deko binding 1000000 times
ok ~145 ms (0 s + 145026498 ns)
# auto-bind all 1000000 times
ok ~719 ms (0 s + 718651445 ns)
# auto-bind with [ 'onclickedBound' ] opts 1000000 times
ok ~1.68 s (1 s + 684526786 ns)
all benchmarks completed
ok ~2.57 s (2 s + 571800372 ns)
License
MIT