Skip to content

A repository of common design patterns written in Typescript.

Notifications You must be signed in to change notification settings

deeckn/design-patterns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Design Patterns

A repository of common design patterns written in Typescript.

Credits:

Getting Started

Node and Yarn is required.

  1. yarn install to install dependencies
  2. (Optional) Install Prettier VSCode extension, if you want to play around while keeping code consistency

Viewing Examples

Choose a design pattern by changing the enum in the example variable in src/index.ts.

enum DesignPattern {
    FACTORY = 'factory',
    MEMENTO = 'memento',
    STATE = 'state',
    ITERATOR = 'iterator',
    COMPOSITE = 'composite',
    BRIDGE = 'bridge',
    MEDIATOR = 'mediator',
    PROXY = 'proxy',
    CHAIN_OF_RESPONSIBILITY = 'chain',
    FLYWEIGHT = 'flyweight',
}

const example: DesignPattern = DesignPattern.FLYWEIGHT // Edit here
  1. yarn build to transpile Typescript to Javascript
  2. yarn start to run the script
  3. (Optional) yarn dev to run a nodemon development server

About

A repository of common design patterns written in Typescript.

Resources

Stars

Watchers

Forks