Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/development/fe_guide/design_patterns.md46
1 files changed, 0 insertions, 46 deletions
diff --git a/doc/development/fe_guide/design_patterns.md b/doc/development/fe_guide/design_patterns.md
index ffca801fd03..a2f1a517d79 100644
--- a/doc/development/fe_guide/design_patterns.md
+++ b/doc/development/fe_guide/design_patterns.md
@@ -1,51 +1,5 @@
# Design Patterns
-## Singletons
-
-As with everything at GitLab, the simplest approach should be taken.
-Below we have defined a few patterns to achieve singleton-like behaviour.
-Pick the simplest one that fits your usecase.
-
-```javascript
-const MyThing = {
- prop: 'hello',
- init: () => {}
-};
-
-export default MyThing;
-```
-
-```javascript
-class MyThing {
- constructor() {
- this.prop = 'hello';
- }
- init() {}
-}
-
-export default new MyThing();
-```
-
-```javascript
-
-export default class MyThing {
- constructor() {
- if (!this.prototype.singleton) {
- this.init();
- this.prototype.singleton = this;
- }
- return this.prototype.singleton;
- }
-
- init() {
- this.prop = 'hello';
- }
-
- method1() {}
-}
-
-```
-
## Manipulating the DOM in a JS Class
When writing a class that needs to manipulate the DOM guarantee a container option is provided.