Commit a3c0f9ca authored by Martin Wortschack's avatar Martin Wortschack

Merge branch 'docs-fix-singleton-example' into 'master'

Fix singleton example in FE design patterns

See merge request gitlab-org/gitlab!21720
parents a55eed83 ad82eb2e
...@@ -31,11 +31,11 @@ export default new MyThing(); ...@@ -31,11 +31,11 @@ export default new MyThing();
export default class MyThing { export default class MyThing {
constructor() { constructor() {
if (!this.prototype.singleton) { if (!MyThing.prototype.singleton) {
this.init(); this.init();
this.prototype.singleton = this; MyThing.prototype.singleton = this;
} }
return this.prototype.singleton; return MyThing.prototype.singleton;
} }
init() { init() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment