Singleton Use Case : Design Patterns in TypeScript

Singleton Use Case : Design Patterns in TypeScript

Channel:
Subscribers:
24,900
Published on ● Video Link: https://www.youtube.com/watch?v=7LPLT2vgUJk



Duration: 3:27
0 views
0


Design Patterns In TypeScript (book)
https://www.amazon.com/dp/B0948BCH24 : ASIN B0948BCH24
https://www.amazon.com/dp/B094716FD6 : ASIN B094716FD6

Documentation : https://sbcode.net/typescript/singleton/#singleton-use-case

In the example, there are three games created. They are all independent instances created from their own class, but they all share the same leaderboard. The leaderboard is a Singleton.

It doesn't matter how the Games where created, or how they reference the leaderboard, it is always a Singleton.

Each game independently adds a winner, and all games can read the altered leaderboard regardless of which game updated it.

#singletonPattern
#typescriptSingleton
#singletonPatternTypescript







Tags:
Design Patterns In TypeScript
TypeScript
Design Patterns
singleton
singleton pattern