#singleton-pattern

[ follow ]
CodeProject
1 week ago
JavaScript

Thread-Safe Singleton in C#: A Guide to Double-Checked Locking and Lazy Approaches

The Singleton pattern provides a globally accessible, single instance of a class, enhancing code flexibility and efficiency. [ more ]
Marcin Wanago Blog - JavaScript, both frontend and backend
5 months ago
JavaScript

API with NestJS #148. Understanding the injection scopes

NestJS default behavior is singleton provider scope for classes, sharing one instance for increased performance.
Request scope can be implemented for classes like logged-in-user.service.ts to be initialized per HTTP request. [ more ]
Medium
7 months ago
JavaScript

7 Node.js Design Patterns Every Developer Should Know

The Facade design pattern simplifies complex subsystems by providing a unified interface.
The Singleton pattern ensures that a class has one global instance that can be accessed using a static method. [ more ]
[ Load more ]