Passed
Push — master ( 923e12...5d294b )
by Jonathan
26:47
created

Autoloader.constructor   A

Complexity

Conditions 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
dl 0
loc 3
rs 10
1
import { List } from './list'
2
import { Edit } from './edit'
3
import { Detail } from './detail'
4
5
class Autoloader {
6
    constructor() {
7
        this.lazyLoad()
8
    }
9
10
    lazyLoad() {
11
        let page = $('meta[name="page"]').attr('content')
12
13
        switch (page) {
14
            case 'list':
15
                new List()
16
                break;
17
18
            case 'edit':
19
                new Edit()
20
                break;
21
22
            case 'detail':
23
                new Detail()
24
                break;
25
        }
26
    }
27
}
28
29
new Autoloader()
0 ignored issues
show
Unused Code Best Practice introduced by
The object created with new Autoloader() is not used but discarded. Consider invoking another function instead of a constructor if you are doing this purely for side effects.
Loading history...