摘要: const person = { name: "wan", age: 28 } type Person = typeof person type PersonKeys = keyof person // "name" | "age" type PersonKTypes = Person[Person 阅读全文
posted @ 2020-09-30 20:20 Zhentiw 阅读(128) 评论(0) 推荐(0)
摘要: In Javascript, you know typeof: typeof [] // object typeof "" // string In Typescript it is more smart: const person = { name: "wan", age: 28 } type P 阅读全文
posted @ 2020-09-30 20:11 Zhentiw 阅读(131) 评论(0) 推荐(0)
摘要: import { compose } from "ramda"; let input = document.getElementById("input"); let inputBroadcaster = (listener) => { input.addEventListener("input", 阅读全文
posted @ 2020-09-30 18:32 Zhentiw 阅读(171) 评论(0) 推荐(0)
摘要: import { compose } from "ramda"; let input = document.getElementById("input"); let inputBroadcaster = (listener) => { input.addEventListener("input", 阅读全文
posted @ 2020-09-30 18:12 Zhentiw 阅读(135) 评论(0) 推荐(0)
摘要: See the following example: const elem = document.querySelector('.click'); function handleClick(event: Event) { event.preventDefault(); console.log(thi 阅读全文
posted @ 2020-09-30 01:17 Zhentiw 阅读(393) 评论(0) 推荐(0)