Advertisement
Guest User

Untitled

a guest
Oct 27th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. 'use strict';
  2. import Singleton from 'Singleton';
  3.  
  4. class ClassA extends Singleton {
  5. constructor() {
  6. super();
  7. }
  8.  
  9. singletonMethod1() {
  10. // ...
  11. }
  12.  
  13. singletonMethod2() {
  14. // ...
  15. }
  16.  
  17. // ...
  18. }
  19.  
  20. console.log(
  21. ClassA.instance === ClassA.instance,
  22. ClassA.instance === new ClassA,
  23. new ClassA === new ClassA
  24. ); // true, true, true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement