Gator.js - simple event delegation in ~800 bytes
craig.is
craig.is
[1] https://github.com/ccampbell/gator/blob/0c8fafad45202c018706...
Gator
.on(x, e1, s1, c1)
.on(x, e2, s2, c2)
;
Or is chaining desired after partial application (meaning `x` is chained)? var onX = chainFn(Gator.on, x);
onX
(e1, s1, c1)
(e2, s2, c2)
;
It seems that a library can provide chaining if needed.I think the point may be "Gator.on()" wouldn't need instances of anything allocated.
But then you lose chaining.
As for WeakMap, I wasn't even aware of that, looks awesome.