Skip to content

Instantly share code, notes, and snippets.

@annevk

annevk/gist:5238964

Last active Dec 15, 2015
Embed
What would you like to do?
on() / off() sketch.
Using some experimental JS IDL syntax:
augment EventTarget {
EventTarget on(String type, EventListener callback,
{boolean ignoreBubbles?,
String? filter = null,
enum("capturing", "target", "bubbling") phase = "bubbling",
String? marker = null});
EventTarget off(String type, EventListener callback);
EventTarget off({ String? type = null, String? marker = null });
}
filter takes a selector. When filter is supplied ignoreBubbles defaults to true
which means the Event.bubbles property is ignored during event dispatch making
event delegation work better.
marker can be used for namespacing. E.g. to remove all event listeners at once
registered for the "button" component.
Everything else is as you expect it.
@zolkis

This comment has been minimized.

Copy link

@zolkis zolkis commented Oct 1, 2013

Lovely. Any update on when can we have this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.