🧰 Developer’s toolbox: 🍾 Singleton Design Pattern
Recently, I came across an article written by Eduards Sizovs: STOP LEARNING FRAMEWORKS. It made me think about how many hypes are produced each month with new languages/frameworks, and how many of them are forgotten after one month. They come and go, but some things stay for a very long time. So, I decided to revisit a few topics: design patterns, data structures, sorting/searching algorithms, etc.
For now, I created Developers-toolbox repo, together with the first design pattern: 💍 Singleton implemented in Swift and TypeScript (open for PR of other languages). Ideally, a few months in I will populate it with many examples and interesting use cases.
🍾 Singleton
Ensures a class has only one instance and provides a global point of access to it. Use cases: provide a unified access point to a resource or service that’s shared across an app/service, like an audio channel to play sound effects or a network manager to make HTTP requests.
Github repo: link.
Swift
TypeScript
P.S. We would be happy to see comments according to mistakes & typos.