Skip to content

Commit 96d56f6

Browse files
committed
2020.10.09
1 parent db279df commit 96d56f6

2 files changed

Lines changed: 8 additions & 77 deletions

File tree

Cute-Gist/Patterns/AdapterPattern copy.ts

Lines changed: 0 additions & 75 deletions
This file was deleted.

Cute-Gist/Patterns/SingletonPattern.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ class Singleton {
1717
}
1818
}
1919

20-
const leo: Single = Singleton.getInstance();
20+
const leo: Single = Singleton.getInstance();
21+
const leo2: Single = Singleton.getInstance();
2122
console.log("leo:", leo)
22-
leo.singletonOperation();
23+
leo.singletonOperation();
24+
25+
console.log(leo == leo2)
26+
// [LOG]: "leo:", Singleton: {}
27+
// [LOG]: "hello Singleton Patterns!"
28+
// [LOG]: true

0 commit comments

Comments
 (0)