summaryrefslogtreecommitdiff
path: root/doc/development/frontend.md
diff options
context:
space:
mode:
Diffstat (limited to 'doc/development/frontend.md')
-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