Closed
Bug 636142
Opened 13 years ago
Closed 13 years ago
EventEmitter.once
Categories
(Add-on SDK Graveyard :: General, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: irakli, Assigned: irakli)
Details
Attachments
(2 files)
In many cases we set an event listener that is removes itself on a first call. I think it will be extremely useful to implement following API: eventEmitter.once('EventType', listener). Also similar thing have recently been added to [nodejs](http://nodejs.org/docs/v0.4.1/api/events.html#emitter.once). As a matter of fact all other major frameworks also provide APIs to do similar thing. In addition I would also propose to implement following low lever module 'api-utils/dom/events' (as this seems to be very useful with regular dom events): require('dom/events').on(element, 'load', onLoad, [capture=false]) require('dom/events').removeListener(element, 'load', onLoad, [capture=false]) require('dom/events').once(element, 'load', onLoadOnly, [capture=false])
Assignee | ||
Comment 1•13 years ago
|
||
Assignee | ||
Updated•13 years ago
|
Attachment #515173 -
Flags: review?(myk)
Comment 2•13 years ago
|
||
Comment on attachment 515173 [details]
Pointer to pull request
Just a few minor issues, as noted in the pull request.
Attachment #515173 -
Flags: review?(myk) → review-
Assignee | ||
Comment 3•13 years ago
|
||
Assignee | ||
Updated•13 years ago
|
Attachment #519107 -
Flags: review?(myk)
Assignee | ||
Updated•13 years ago
|
Assignee: nobody → rFobic
Updated•13 years ago
|
Attachment #519107 -
Flags: review?(myk) → review+
Assignee | ||
Updated•13 years ago
|
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•