Raynos / dom-delegator

Decorate elements with delegated events
MIT License
58 stars 16 forks source link

Support for capture phased listeners #27

Open Gozala opened 8 years ago

Gozala commented 8 years ago

Any chance support for this to be added ? Also I have being wondering what is the reason for dom-delegators use of captured phase listener over bubble phased one ?

https://github.com/Raynos/dom-delegator/blob/master/dom-delegator.js#L84

The reason I'm asking is because I could use a different thing for captured phase listeners and dom-delegator for bubbled ones but then because dom-delegator uses captured phase itself it will be triggered prior to my captured phase listeners.

Raynos commented 8 years ago

The idea for capture phase was performance. I wanted to capture the event as early as possible and manually delegate to the correct listener on a virtual node.