-
Notifications
You must be signed in to change notification settings - Fork 10
/
classes.cson
45 lines (44 loc) · 819 Bytes
/
classes.cson
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
".source.js, .source.jsx, .source.ts":
"class":
prefix: "cs"
body: """
class ${1:ClassName} {
constructor (${2:args}) {
${3}
}
}
"""
"class extends":
prefix: "csx"
body: """
class ${1:ClassName} extends ${2:BaseClass} {
constructor (${3:args}) {
super(${3:args})
${4}
}
}
"""
"class method":
prefix: "csm"
body: """
${1:name} (${2:args}) {
${3}
}
"""
"es5 singleton class":
prefix: "csi"
body: """
function ${1:ClassName} (${2:args}) {
if (!(this instanceof ${1:ClassName})) {
return new ${1:ClassName}(${2:args})
}
${3}
}
"""
"es5 function class":
prefix: "csf"
body: """
function ${1:ClassName} (${2:args}) {
${3}
}
"""