diff --git a/README.md b/README.md index d23b631..9905804 100644 --- a/README.md +++ b/README.md @@ -454,6 +454,14 @@ h('div', [ ]); ``` +Each handler is called not only with the given arguments but also with the current event and vnode appended to the argument list. It also supports using multiple listeners per event by specifying an array of handlers: +```javascript +stopPropagation = function(ev) { ev.stopPropagation() } +sendValue = function(func, ev, vnode) { func(vnode.elm.value) } + +h('a', { on:{ click:[[sendValue, console.log], stopPropagation] } }); +``` + Snabbdom allows swapping event handlers between renders. This happens without actually touching the event handlers attached to the DOM.