Tokimon / vanillajs-browser-helpers

Vanilla JS helper methods for in browser usage

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`delegateHandler` needs event type that includes `delegateTarget`

Tokimon opened this issue · comments

in a usage I had to hack the type a bit to make TS accept e.delegateTarget:

const onClick = delegateHandler(`.${fileTileContainer}`, (e: Event) => {
  const { delegateTarget: thumb } = e as Event & { delegateTarget: Element };
  dispatch('thumbclick', { thumb });
});