上一页 1 ··· 173 174 175 176 177 178 179 180 181 ··· 491 下一页
摘要: In lodash, you can use 'mixin' to create a new function on lodash object. import * as _ from 'lodash'; _.chunk([1, 2, 3, 4], 2); // [[1,2], [3,4]] _.m 阅读全文
posted @ 2020-10-09 01:19 Zhentiw 阅读(92) 评论(0) 推荐(0)
摘要: Instead of first checking to see if a record already exists within your table, we can do a on conflict do update. In this command, we can ether insert 阅读全文
posted @ 2020-10-08 02:25 Zhentiw 阅读(171) 评论(0) 推荐(0)
摘要: 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 阅读(136) 评论(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 阅读(155) 评论(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 阅读(81) 评论(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 阅读(279) 评论(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 阅读(82) 评论(0) 推荐(0)
摘要: tsconfig.json: { "compilerOptions": { "target": "es5", "lib": ["es6", "dom"], "module": "commonjs", "outDir": "dist", "noUnusedLocals": true, "noUnuse 阅读全文
posted @ 2020-10-05 18:11 Zhentiw 阅读(106) 评论(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 阅读(197) 评论(0) 推荐(0)
上一页 1 ··· 173 174 175 176 177 178 179 180 181 ··· 491 下一页