-
Notifications
You must be signed in to change notification settings - Fork 10
/
functions.cson
46 lines (41 loc) · 1.09 KB
/
functions.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
46
".source.js, .source.jsx, .source.ts":
"anonymous function":
prefix: "f"
body: "function (${1:args}) {${0}}"
"named function":
prefix: "fn"
body: "function ${1:name} (${2:args}) {${0}}"
"async anonymous function":
prefix: "asf"
body: "async function (${1:args}) {${0}}"
"async named function":
prefix: "asfn"
body: "async function ${1:name} (${2:args}) {${0}}"
"arrow function":
prefix: "af"
body: "(${1:args}) => ${2:statement}"
"arrow fn with body":
prefix: "afn"
body: "(${1:args}) => {${0}}"
"generator":
prefix: "gf"
body: "function * (${1:args}) {${0}}"
"named generator":
prefix: "gfn"
body: "function * ${1:name} (${2:args}) {${0}}"
"immediately-invoked function expression":
prefix: "iife"
body: """
;(function (${1:args}) {
${0}
})(${2})
"""
"function apply":
prefix: "fa"
body: "${1:fn}.apply(${2:this}, ${3:args})"
"function call":
prefix: "fc"
body: "${1:fn}.call(${2:this}, ${3:args})"
"function bind":
prefix: "fb"
body: "${1:fn}.bind(${2:this}, ${3:args})"