摘要:
For example: const tuple = ['tesla', 'model 3', 'model X', 'model Y'] as const type result = TupleToObject<typeof tuple> // expected { tesla: 'tesla', 阅读全文
摘要:
For example: interface Todo { title: string description: string } const todo: MyReadonly<Todo> = { title: "Hey", description: "foobar" } todo.title = 阅读全文
摘要:
For example: interface Todo { title: string description: string completed: boolean } type TodoPreview = MyPick<Todo, 'title' | 'completed'> const todo 阅读全文
摘要:
Reuse existing instances when working with identical objects The flyweight pattern is useful when you're creating a huge number of objects, which coul 阅读全文