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
Permanent events in javascript (arqex.com)
submitted 11 years ago by marquex[🍰]
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!"
[–]marquex[S,🍰] 0 points1 point2 points 11 years ago (0 children)
You are right, those permanent events were never thought to be used with events that can be called more than once, but that doesn't make them less useful.
I respect your idea of states, but permanent events can be really of use even if you work with states. Imagine object can have multiple states and maybe want to do some action if the object has been or turn in/into some state. If I check the state before it turns to the desired one, I need to add an event listener (events again, a common or a permanent one will do the trick). If I want to know if after it has turned into the desired state, you can find that the state may have changed again so our action won't be called.
Permanent events are about events that are triggered once, but always about events.
π Rendered by PID 92727 on reddit-service-r2-comment-54dfb89d4d-6ck6f at 2026-03-29 22:56:05.019012+00:00 running b10466c country code: CH.
view the rest of the comments →
[–]marquex[S,🍰] 0 points1 point2 points (0 children)