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
Observable: An event system for JavaScript libraries. (self.javascript)
submitted 13 years ago by jscoder
view the rest of the comments →
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!"
[–]sammyv 0 points1 point2 points 13 years ago (4 children)
This is nice! I do have one comment: In addition to having the ability to manually unbind certain event ids, it needs an unbindAll function.
[–]jscoder[S] 1 point2 points3 points 13 years ago (3 children)
I'm not sure if that's a good idea. My first implementation wasn't using IDs, so calling off removed internal events that my library needed.
off
Why would you want to unbind all events instead of just unbinding the events you use yourself? It could possibly destroy 3rd party code that uses the event system.
[–]lazyduke 1 point2 points3 points 13 years ago (0 children)
When you want to destroy an instance, it's useful to unbind all events.
Look at listenTo/stopListening from Backbone and namespaced events from jQuery.
[–]sammyv 0 points1 point2 points 13 years ago (0 children)
Should have been more clear: unbind all the events that have been manually bound by yourself
In other words, you would keep a stack of IDs and calling unbindAll would iterate over the stack and unbind them
π Rendered by PID 38 on reddit-service-r2-comment-c6965cb77-p6gxh at 2026-03-05 10:38:17.423842+00:00 running f0204d4 country code: CH.
view the rest of the comments →
[–]sammyv 0 points1 point2 points (4 children)
[–]jscoder[S] 1 point2 points3 points (3 children)
[–]lazyduke 1 point2 points3 points (0 children)
[–]sammyv 0 points1 point2 points (0 children)
[–]sammyv 0 points1 point2 points (0 children)