TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Gator.js - simple event delegation in ~800 bytes

28 pointsby craigcover 12 years ago

1 comment

stragerover 12 years ago
Why is there a Gator function when the only interface is `Gator(x).on(e, s, c)` and `Gator(x).off(e, s, c)`? Why not `Gator.on(x, e, s, c)` and rely on the caller to do partial function application (e.g. with `Function.prototype.bind`)? This seems like unnecessary memory bloat[1].<p>[1] <a href="https://github.com/ccampbell/gator/blob/0c8fafad45202c018706082d976b2cf4430e7b84/gator.js#L264-L278" rel="nofollow">https://github.com/ccampbell/gator/blob/0c8fafad45202c018706...</a>
评论 #4843658 未加载
评论 #4843648 未加载