Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Design Patterns in TypeScript

It contains TypeScript examples for all classic GoF design patterns. Each pattern includes two examples:

  • Conceptual examples show the internal structure of patterns, including detailed comments.

  • RealWorld examples show how patterns can be used in real-world web applications.

Requirements

For simplicity reasons, the examples are console apps. In order to launch them, you have to install Node.js and NPM on your computer and then install TypeScript compiler and TypeScript Node extension like this:

npm install -g typescript
npm install -g ts-node

When you have all the required software installed, the examples can be launched via the command line as follows:

ts-node src/Path-to-example/Example.ts

For the best experience, I recommend working with examples with these IDEs:

Guide

Here's a style guide which might help you to keep your changes consistent with the rest of the project's code:

  1. All code should follow these two guidelines: Unofficial TypeScript StyleGuide and Airbnb JavaScript Style Guide.

  2. Try to hard wrap the code at 80th's character. It helps to list the code on the website without scrollbars.

  3. Example files should be located and named in the following manner:

    src/{PatternName}/{ExampleName}/index.ts
    
  4. Aim to put all code within one file. Yes, I realize that it's not how it supposed to be done in production. But it helps people to better understand examples, since all code fits into one screen.

License

This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.

Creative Commons License

About

Design Patterns (Examples on TypeScript)

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages