Closed Bug 935120 Opened 11 years ago Closed 7 years ago

Alias sdk/events to `events` for node

Categories

(Add-on SDK Graveyard :: General, defect, P3)

x86
macOS
defect

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: jsantell, Unassigned)

References

Details

Attachments

(1 file)

Priority: -- → P3
Attached file node's event
* Moved `sdk/event/target` to `node/events` -- changed exposed object from `EventTarget` to `EventEmitter`. No deprecation until we're ready.
* Added `removeAllListeners(type)` to EventEmitter. Similar to off(target) and off(target, type).
* Added `listeners(type)` to return listener count
* Added `emitter.emit` return boolean indicating if there were any listeners listening
* Added static method `EventEmitter.listenerCount()`, same as listeners(type)
* Added events 'newListener' and 'removeListener' to be fired upon adding/removing listeners.
* Added alias for `on`: `addListener`
* Node's `setMaxListeners()` was noop'd, but not implemented here -- may incur too much overhead.

All this is for node parity.
Attachment #8357457 - Flags: review?(evold)
Comment on attachment 8357457 [details] [review]
node's event

It looks like this patch will add `addListener` api to everything that implements EventTarget.  Irakli are you ok with this?
Attachment #8357457 - Flags: feedback?(rFobic)
Assignee: nobody → jsantell
For clarity, this will add all of these methods to anything that implements EventTarget (which is alised to node EventEmitter)
Comment on attachment 8357457 [details] [review]
node's event

Assuming that Irakli says the api change is alright r+
Attachment #8357457 - Flags: review?(evold) → review+
Comment on attachment 8357457 [details] [review]
node's event

Jordan we had a chat about it on IRC and I had some arguments against this change. This does not means I can't be convinced otherwise, but right now
I'm saying no as I don't see a much value in doing this.

Feel free to followup and convince me I'm wrong if you still disagree.
Attachment #8357457 - Flags: feedback?(rFobic) → feedback-
Nah, we're in agreement -- putting this on hold until we figure out what to do with these node modules
Unassigning myself from bugs I haven't gotten around to
Assignee: jsantell → nobody
https://bugzilla.mozilla.org/show_bug.cgi?id=1399562
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: