上一页 1 ··· 23 24 25 26 27 28 29 30 31 ··· 465 下一页
摘要: defermake sure the operation will be executed at the end of a function. func loadChampions() ([]champion, error) { file, err := os.Open("tft_champions 阅读全文
posted @ 2024-02-06 03:22 Zhentiw 阅读(3) 评论(0) 推荐(0) 编辑
摘要: A memory pool, also known as a memory buffer pool, is a method used in software development for managing memory allocation. Instead of allocating and 阅读全文
posted @ 2024-02-05 16:00 Zhentiw 阅读(7) 评论(0) 推荐(0) 编辑
摘要: Covariance - producer - out - function return position - same arrow direction Contravariance - packager - in - function param position - different arr 阅读全文
posted @ 2024-02-01 16:03 Zhentiw 阅读(4) 评论(0) 推荐(0) 编辑
摘要: Our project might have a file structure like Our project might have a file structure like data/ book.ts // A model for Book records magazine.ts // A m 阅读全文
posted @ 2024-01-31 16:02 Zhentiw 阅读(14) 评论(0) 推荐(0) 编辑
摘要: type AnyProppertyKey = keyof any Example: type Example = Record<AnyProertyKey, any> 阅读全文
posted @ 2024-01-31 15:10 Zhentiw 阅读(1) 评论(0) 推荐(0) 编辑
摘要: Since typescript 5, we are able to add constraints over infer. Following code doesn't apply constraints, so the inferred element could be stringand nu 阅读全文
posted @ 2024-01-29 23:44 Zhentiw 阅读(5) 评论(0) 推荐(0) 编辑
摘要: type OneArgFn<A = any> = (firstArg: A, ..._args: any[]) => void type GetFirstArg<T> = T extends OneArgFn<infer R> ? R : never; // Test case function f 阅读全文
posted @ 2024-01-29 23:39 Zhentiw 阅读(2) 评论(0) 推荐(0) 编辑
摘要: Particularly if you use a bundler like webpack, parcel or snowpack, you may end up importing things that aren’t .js or .ts files For example, maybe yo 阅读全文
posted @ 2024-01-29 14:58 Zhentiw 阅读(4) 评论(0) 推荐(0) 编辑
摘要: Node.js 13.2.0 introduced support for native ES modules. This means you can natively run code containing thing like import { Foo } from 'bar', use top 阅读全文
posted @ 2024-01-29 14:47 Zhentiw 阅读(6) 评论(0) 推荐(0) 编辑
摘要: Let's say we need to use a library with commonJS code. class Melon { cutIntoSlices() { } } module.exports = Melon Then we want to import this inside o 阅读全文
posted @ 2024-01-28 20:36 Zhentiw 阅读(5) 评论(0) 推荐(0) 编辑
上一页 1 ··· 23 24 25 26 27 28 29 30 31 ··· 465 下一页