上一页 1 ··· 180 181 182 183 184 185 186 187 188 ··· 498 下一页
摘要: The useDebugValue hook will not effect your user experience but is instead aimed at improving the developer experience. When building your own custom 阅读全文
posted @ 2020-10-08 02:19 Zhentiw 阅读(144) 评论(0) 推荐(0)
摘要: function reverse(str: string): string; function reverse<T>(arr: T[]): T[]; function reverse<T>(stringOrArray: string | T[]): string | T[] { if (typeof 阅读全文
posted @ 2020-10-06 18:20 Zhentiw 阅读(163) 评论(0) 推荐(0)
摘要: class Pizza { constructor(private name: string, private price: number) {} } class List<T> { private list: T[]; addItem(item: T): void { this.list.push 阅读全文
posted @ 2020-10-06 18:14 Zhentiw 阅读(91) 评论(0) 推荐(0)
摘要: Discriminated (Tagged) Unions means that for two or more similar types, we have one common prop which can differentiate individual. interface Order { 阅读全文
posted @ 2020-10-06 15:27 Zhentiw 阅读(281) 评论(0) 推荐(0)
摘要: interface Order { id: string; amount: number; currency: string; } interface Stripe { card: string; cvc: string; } interface PayPal { email: string; } 阅读全文
posted @ 2020-10-06 15:18 Zhentiw 阅读(79) 评论(0) 推荐(0)
摘要: When we use class extend in typescript: // app.ts export default class App {} // bar.ts export defulat class Bar extends App { } After compiling, we w 阅读全文
posted @ 2020-10-05 18:29 Zhentiw 阅读(85) 评论(0) 推荐(0)
摘要: tsconfig.json: { "compilerOptions": { "target": "es5", "lib": ["es6", "dom"], "module": "commonjs", "outDir": "dist", "noUnusedLocals": true, "noUnuse 阅读全文
posted @ 2020-10-05 18:11 Zhentiw 阅读(115) 评论(0) 推荐(0)
摘要: Sometime if our tsconfig.json looks like this; { "compilerOptions": { "target": "es5", "module": "commonjs", "outDir": "dist" } } We can get all kinds 阅读全文
posted @ 2020-10-05 17:46 Zhentiw 阅读(206) 评论(0) 推荐(0)
摘要: tsconfig-base.json: { "compilerOptions": { "target": "es5", "module": "commonjs", "lib": ["dom", "es6"], "outDir": "dist", "noImplicitAny": false } } 阅读全文
posted @ 2020-10-05 03:03 Zhentiw 阅读(97) 评论(0) 推荐(0)
摘要: class Song { constructor(public title: string, public duration: number) { } } class Playlist { constructor(public name: string, public songs: Song[]) 阅读全文
posted @ 2020-10-04 01:22 Zhentiw 阅读(140) 评论(0) 推荐(0)
上一页 1 ··· 180 181 182 183 184 185 186 187 188 ··· 498 下一页