Created
June 12, 2019 18:48
Typescript - type for HTMLElementEvent
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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