摘要:
For example: const tuple = ['tesla', 'model 3', 'model X', 'model Y'] as const type result = TupleToObject<typeof tuple> // expected { tesla: 'tesla', 阅读全文
posted @ 2022-08-31 15:51
Zhentiw
阅读(34)
评论(0)
推荐(0)
摘要:
For example: interface Todo { title: string description: string } const todo: MyReadonly<Todo> = { title: "Hey", description: "foobar" } todo.title = 阅读全文
posted @ 2022-08-31 15:26
Zhentiw
阅读(31)
评论(0)
推荐(0)
摘要:
For example: interface Todo { title: string description: string completed: boolean } type TodoPreview = MyPick<Todo, 'title' | 'completed'> const todo 阅读全文
posted @ 2022-08-31 15:23
Zhentiw
阅读(43)
评论(0)
推荐(0)
摘要:
Reuse existing instances when working with identical objects The flyweight pattern is useful when you're creating a huge number of objects, which coul 阅读全文
posted @ 2022-08-31 14:59
Zhentiw
阅读(18)
评论(0)
推荐(0)

浙公网安备 33010602011771号