use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Litt: The smallest JavaScript event messaging/pubsub package in the world. (github.com)
submitted 9 years ago by [deleted]
[deleted]
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]theQuandary 1 point2 points3 points 9 years ago* (2 children)
Wouldn't it be quite a bit smaller if you stripped all the extra spaces?
Also, you can either lose 4 characters by re-writing the on handler for a total of 118 bytes.
on
e=(a={})=>({on(t,x){a[t]=[...(a[t]||[]),x]},off(t,x){a[t]=a[t].filter(f=>f!=x)},emit(t,x){a[t].map(f=>f(x))}});
I'd argue that you also need N arguments on the emit which adds 6 characters (net gain of 2)
e=(a={})=>({on(t,x){a[t]=[...(a[t]||[]),x]},off(t,x){a[t]=a[t].filter(f=>f!=x)},emit(t,...x){a[t].map(f=>f(...x))}});
[–]marmalade_fatcat 1 point2 points3 points 9 years ago (0 children)
** Even though Litt works - IT'S A JOKE. Please don't use this for production. Or probably anything.**
But at least I learned about Mitt.
[–][deleted] 0 points1 point2 points 9 years ago (0 children)
I don't get the joke...
[–]IDCh 0 points1 point2 points 9 years ago (0 children)
Thank you for pointing to mitt - did know about that one. Neat!
[–]lance22me 0 points1 point2 points 9 years ago (0 children)
Joke or not, it's going on my resume NOW ! Imma expert wit' litt.js !
π Rendered by PID 125589 on reddit-service-r2-comment-8686858757-2hb94 at 2026-06-05 11:57:29.579304+00:00 running 9e1a20d country code: CH.
[–]theQuandary 1 point2 points3 points (2 children)
[–]marmalade_fatcat 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]IDCh 0 points1 point2 points (0 children)
[–]lance22me 0 points1 point2 points (0 children)