Skip to content

Instantly share code, notes, and snippets.

@Kamilnaja
Created June 12, 2019 18:48
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