TS 中文文档 TS 中文文档
指南
GitHub (opens new window)
指南
GitHub (opens new window)
  • 入门教程

    • TypeScript 手册
    • 基础知识
    • 日常类型
    • 类型缩小
    • 更多关于函数
    • 对象类型
    • 从类型创建类型
    • 泛型
    • Keyof 类型运算符
    • Typeof 类型运算符
    • 索引访问类型
    • 条件类型
    • 映射类型
    • 模板字面类型
    • 类
    • 模块
  • 参考手册

  • 项目配置

TypeScript Design Patterns


TypeScript Design Patterns by Packt. It contains all the supporting project files necessary to work through the book from start to finish.

Instructions and Navigation


This is the code repository for TypeScript Design Patterns, published by Packt. There are no additional code bundle for the following chapters:

Chapter 8- SOLID Principles
Chapter 9- The Road to Enterprise Application

Chapter 8 is mainly about explaining SOLID principles, so the code bundles are about concepts without actual implementation. Chapter 9 is about a workflow and related configurations, so it is rather trivial to put them as code bundles into files.

Cloning and Browsing


To clone this repository, you will need to install Git and run git clone command with the URL of this repository:

  1. ``` shell
  2. git clone https://github.com/PacktPublishing/TypeScript-Design-Patterns.git
  3. ```

In package.json file, we have already added the dependency of TypeScript module, and configured it as the language server of Visual Studio Code with .vscode/settings.json. To browse code in this repository with Visual Studio Code, you can simply install the dependency using npm install and then open the root directory of this repository as a folder in Visual Studio Code.

Compiling Code


To see how would the compiled JavaScript files look like, you can use command npm run tsc -- -p <chapter-folder> to compile. For example, if you want to compile code in chapter-1, execute following command after npm install :

  1. ``` shell
  2. npm run tsc -- -p chapter-1
  3. ```

If you have compatible TypeScript compiler installed globally, you can just use the global tsc command to compile target code bundle.

Please see Chapter 1 of the book for more information.

Description


TypeScript Design Patterns is a collection of the most important patterns you need to improve your applications' performance and your productivity. The journey starts by explaining the current challenges when designing and developing an application and how you can solve these challenges by applying the correct design pattern and best practices.

Related Typescript Products:


TypeScript Essentials
TypeScript Blueprints
Mastering TypeScript

Download a free PDF


If you have already purchased a print or Kindle version of this book, you can get a DRM-free PDF version at no cost.Simply click on the link to claim your free PDF.

https://packt.link/free-ebook/9781785280832
Last Updated: 2023-09-03 17:10:52