Skip to content

Commit

Permalink
Merge pull request ascoders#285 from spiritree/patch-1
Browse files Browse the repository at this point in the history
Update 171.精读《设计模式 - Singleton 单例模式》.md
ascoders authored Nov 26, 2020
2 parents d76253e + 2dbe4d6 commit ad8a645
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion 171.精读《设计模式 - Singleton 单例模式》.md
Original file line number Diff line number Diff line change
@@ -56,7 +56,7 @@ class Ball {
// 构造函数申明为 private,就可以阻止 new Ball() 行为
private constructor() {}

public static instance = () => {
public static getInstance = () => {
if (this._instance === undefined) {
this._instance = new Ball()
}

0 comments on commit ad8a645

Please sign in to comment.