summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryce Johnson <bryce@gitlab.com>2016-11-01 20:40:01 +0100
committerBryce Johnson <bryce@gitlab.com>2016-11-01 20:40:01 +0100
commit2159c8792b289bb27f9947fb834fbd497efeeb28 (patch)
tree1bc2c621d0e9a2f61093c9b28350985339965717
parent7f0ac04db59cb290961bd77a4e0d18cffd248151 (diff)
downloadgitlab-ce-google-singletons-are.tar.gz
Fix spacing in code sample.google-singletons-are
-rw-r--r--doc/development/frontend.md8
1 files changed, 5 insertions, 3 deletions
diff --git a/doc/development/frontend.md b/doc/development/frontend.md
index 735b41314ef..c6aafc926ee 100644
--- a/doc/development/frontend.md
+++ b/doc/development/frontend.md
@@ -227,14 +227,15 @@ class MyThing {
gl.MyThing = new MyThing();
// best
+
let singleton;
class MyThing {
constructor() {
if (!singleton) {
- singleton = this;
- singleton.init();
- }
+ singleton = this;
+ singleton.init();
+ }
return singleton;
}
@@ -246,6 +247,7 @@ class MyThing {
}
gl.MyThing = MyThing;
+
```
## Supported browsers