Skip to content

Instantly share code, notes, and snippets.

@Kamilnaja
Created June 12, 2019 18:48
Show Gist options
  • Save Kamilnaja/c71f572f96b87532c3329bce903a7e7d to your computer and use it in GitHub Desktop.
Save Kamilnaja/c71f572f96b87532c3329bce903a7e7d to your computer and use it in GitHub Desktop.
Typescript - type for HTMLElementEvent
type HTMLElementEvent<T extends HTMLElement> = Event & {
target: T;
}
let res = allEvents$.subscribe((item: HTMLElementEvent<HTMLButtonElement>) => {
console.log(item.target.value);
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment