-
# 인스턴스의 개수를 1개로 제한하는 싱글톤 패턴 | 안정적인 블로그
싱글톤 패턴이란 클래스의 인스턴스가 딱 1개만 생성되는 것을 보장하는 디자인 패턴이다.
[https://ajroot5685.github.io/posts/Singleton-Pattern/](https://ajroot5685.github.io/posts/Singleton-Pattern/)
-
![image](https://github.com/user-attachments/assets/db5ab588-3421-4585-99b8-c29a3a903d9a)
-
```jsx
var Singleton = function (name) {
this.name = name;
};
// 这个就是那个变量用来标示是否为某个类创建过对象
Singleton.instance = null;
Singleton.prototype.getName = function () {
alert(this.name);
};
Sing…
-
-
-
-
The following config can in theory be used to instantiate one object
```yaml
container:
_target_: ...
object1:
_target_: ...
_singleton_: true
object2: ${.object1}
```
```…
-
Make the App() class to be singleton - can be defined only once.
-
Siga o exemplo que está na pasta [Design Pattern] e submeta o seu PR sobre o design pattern desta issue.
-
## Description
Nouveauté !
Au démarrage du projet, nous avons désormais une modale qui s'affiche. Cette modale comprend un formulaire où l'utilisateur va pouvoir rentrer **son prénom** et **son nom*…