|
1 | | -# Design Patterns in TypeScript # |
2 | | - |
3 | | -Here are the implementations of the following design patterns in TypeScript: |
4 | | - |
5 | | -### Creational ### |
6 | | - |
7 | | -* [Singleton](https://github.com/torokmark/design_patterns_in_typescript/tree/master/singleton) |
8 | | -* [Abstract Factory](https://github.com/torokmark/design_patterns_in_typescript/tree/master/abstract_factory) |
9 | | -* [Factory Method](https://github.com/torokmark/design_patterns_in_typescript/tree/master/factory_method) |
10 | | -* [Builder](https://github.com/torokmark/design_patterns_in_typescript/tree/master/builder) |
11 | | -* [Prototype](https://github.com/torokmark/design_patterns_in_typescript/tree/master/prototype) |
12 | | - |
13 | | - |
14 | | -### Structural Patterns ### |
15 | | - |
16 | | -* [Adapter](https://github.com/torokmark/design_patterns_in_typescript/tree/master/adapter) |
17 | | -* [Bridge](https://github.com/torokmark/design_patterns_in_typescript/tree/master/bridge) |
18 | | -* [Composite](https://github.com/torokmark/design_patterns_in_typescript/tree/master/composite) |
19 | | -* [Decorator](https://github.com/torokmark/design_patterns_in_typescript/tree/master/decorator) |
20 | | -* [Facade](https://github.com/torokmark/design_patterns_in_typescript/tree/master/facade) |
21 | | -* [Flyweight](https://github.com/torokmark/design_patterns_in_typescript/tree/master/flyweight) |
22 | | -* [Proxy](https://github.com/torokmark/design_patterns_in_typescript/tree/master/proxy) |
23 | | - |
24 | | - |
25 | | -### Behavioral Patterns ### |
26 | | - |
27 | | -* [Chain of Responsibility](https://github.com/torokmark/design_patterns_in_typescript/tree/master/chain_of_responsibility) |
28 | | -* [Command](https://github.com/torokmark/design_patterns_in_typescript/tree/master/command) |
29 | | -* [Interpreter](https://github.com/torokmark/design_patterns_in_typescript/tree/master/interpreter) |
30 | | -* [Iterator](https://github.com/torokmark/design_patterns_in_typescript/tree/master/iterator) |
31 | | -* [Mediator](https://github.com/torokmark/design_patterns_in_typescript/tree/master/mediator) |
32 | | -* [Memento](https://github.com/torokmark/design_patterns_in_typescript/tree/master/memento) |
33 | | -* [Observer](https://github.com/torokmark/design_patterns_in_typescript/tree/master/observer) |
34 | | -* [State](https://github.com/torokmark/design_patterns_in_typescript/tree/master/state) |
35 | | -* [Strategy](https://github.com/torokmark/design_patterns_in_typescript/tree/master/strategy) |
36 | | -* [Template Method](https://github.com/torokmark/design_patterns_in_typescript/tree/master/template_method) |
37 | | -* [Visitor](https://github.com/torokmark/design_patterns_in_typescript/tree/master/visitor) |
38 | | - |
39 | | -## Compile the project |
40 | | - |
41 | | -``` |
42 | | -$ git clone https://github.com/torokmark/design_patterns_in_typescript.git |
43 | | -$ cd design_patterns_in_typescript |
44 | | -$ tsc |
45 | | -``` |
46 | | - |
47 | | -There is a new `tsconfig.json` file in the root direcotry which is responsible for the compiler options. |
48 | | -As it is set the default target is Ecmascript5 now. |
49 | | -Any additional options come here. |
50 | | - |
51 | | -To compile only one pattern, use the following command. |
52 | | - |
53 | | -``` |
54 | | -$ cd design_patterns_in_typescript/visitor |
55 | | -$ tsc --target ES5 visitor.ts |
56 | | -``` |
57 | | -> Here if there is no `--outFile` option then the compiler generates the js counterpart into the current directory. |
| 1 | +# Design Patterns in TypeScript # |
| 2 | + |
| 3 | +Here are the implementations of the following design patterns in TypeScript: |
| 4 | + |
| 5 | +### Creational ### |
| 6 | + |
| 7 | +* [Singleton](https://github.com/torokmark/design_patterns_in_typescript/tree/master/singleton) |
| 8 | +* [Abstract Factory](https://github.com/torokmark/design_patterns_in_typescript/tree/master/abstract_factory) |
| 9 | +* [Factory Method](https://github.com/torokmark/design_patterns_in_typescript/tree/master/factory_method) |
| 10 | +* [Builder](https://github.com/torokmark/design_patterns_in_typescript/tree/master/builder) |
| 11 | +* [Prototype](https://github.com/torokmark/design_patterns_in_typescript/tree/master/prototype) |
| 12 | + |
| 13 | + |
| 14 | +### Structural Patterns ### |
| 15 | + |
| 16 | +* [Adapter](https://github.com/torokmark/design_patterns_in_typescript/tree/master/adapter) |
| 17 | +* [Bridge](https://github.com/torokmark/design_patterns_in_typescript/tree/master/bridge) |
| 18 | +* [Composite](https://github.com/torokmark/design_patterns_in_typescript/tree/master/composite) |
| 19 | +* [Decorator](https://github.com/torokmark/design_patterns_in_typescript/tree/master/decorator) |
| 20 | +* [Facade](https://github.com/torokmark/design_patterns_in_typescript/tree/master/facade) |
| 21 | +* [Flyweight](https://github.com/torokmark/design_patterns_in_typescript/tree/master/flyweight) |
| 22 | +* [Proxy](https://github.com/torokmark/design_patterns_in_typescript/tree/master/proxy) |
| 23 | + |
| 24 | + |
| 25 | +### Behavioral Patterns ### |
| 26 | + |
| 27 | +* [Chain of Responsibility](https://github.com/torokmark/design_patterns_in_typescript/tree/master/chain_of_responsibility) |
| 28 | +* [Command](https://github.com/torokmark/design_patterns_in_typescript/tree/master/command) |
| 29 | +* [Interpreter](https://github.com/torokmark/design_patterns_in_typescript/tree/master/interpreter) |
| 30 | +* [Iterator](https://github.com/torokmark/design_patterns_in_typescript/tree/master/iterator) |
| 31 | +* [Mediator](https://github.com/torokmark/design_patterns_in_typescript/tree/master/mediator) |
| 32 | +* [Memento](https://github.com/torokmark/design_patterns_in_typescript/tree/master/memento) |
| 33 | +* [Observer](https://github.com/torokmark/design_patterns_in_typescript/tree/master/observer) |
| 34 | +* [State](https://github.com/torokmark/design_patterns_in_typescript/tree/master/state) |
| 35 | +* [Strategy](https://github.com/torokmark/design_patterns_in_typescript/tree/master/strategy) |
| 36 | +* [Template Method](https://github.com/torokmark/design_patterns_in_typescript/tree/master/template_method) |
| 37 | +* [Visitor](https://github.com/torokmark/design_patterns_in_typescript/tree/master/visitor) |
| 38 | + |
| 39 | +## Compile the project |
| 40 | + |
| 41 | +``` |
| 42 | +$ git clone https://github.com/torokmark/design_patterns_in_typescript.git |
| 43 | +$ cd design_patterns_in_typescript |
| 44 | +$ tsc |
| 45 | +``` |
| 46 | + |
| 47 | +There is a new `tsconfig.json` file in the root directory which is responsible for the compiler options. |
| 48 | +As it is set the default target is Ecmascript5 now. |
| 49 | +Any additional options come here. |
| 50 | + |
| 51 | +To compile only one pattern, use the following command. |
| 52 | + |
| 53 | +``` |
| 54 | +$ cd design_patterns_in_typescript/visitor |
| 55 | +$ tsc --target ES5 visitor.ts |
| 56 | +``` |
| 57 | +> Here if there is no `--outFile` option then the compiler generates the js counterpart into the current directory. |
0 commit comments