Created
June 12, 2019 18:48
-
-
Save Kamilnaja/c71f572f96b87532c3329bce903a7e7d to your computer and use it in GitHub Desktop.
Typescript - type for HTMLElementEvent
This file contains hidden or 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