Skip to content

abdulrafay02/typescript-design-patterns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

typescript-design-patterns

Repo for learning TypeScript design patterns from this course.

Decorator pattern

The point of the Decorator pattern is to extend (decorate) behaviour of an object, without affecting the behaviour of other objects of the same class.

Observer pattern

Observer pattern is a way of allowing an object to pay atention into the state of another object, and receive an update whenever its states changes. So, we work with two pillars here: the observer, who’s the one looking and waiting for changes, and the subject, which is the one that’s going to be the center of atentions.

Facade pattern

The Facade pattern is one of the structural software design patterns. This pattern hides the complexity of subsystems away from the implementor (client) and it provides an easy-to-use interface to the client.

Adapter pattern

The adapter pattern is one of the structural software design patterns. The main purpose of this pattern is to allow different interfaces (classes) to work together and it achieves this without having to modify the original class. This pattern works with 3 components: a client, an adapter and an adaptee. The client doesn't care about the implementation of the interface, it only wants to access a certain method for example. The adapter class makes sure that this can happen as it provides an interface to the adaptee class - which is the incompatilble class with the client.

State pattern

State pattern allows an object to alter its behavior when its internal state changes. The object will appear to change its class.

About

Repo for learning ts design patterns.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages