-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.yaml
More file actions
99 lines (80 loc) · 2.64 KB
/
utils.yaml
File metadata and controls
99 lines (80 loc) · 2.64 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
importSubModule:
prefix: imps
description: import subModule from modules
body: import { $2 } from '${1:module}';$0';
importModule:
prefix: imp
description: import entire module from modules
body: import ${2:moduleName} from '${1:module}';$0;
importModuleAlias:
prefix: impa
description: import * as alias from module
body: import * as ${1:alias} from '${0:module}';
require:
prefix: rqr
description: Require a package
body: require('${1:package}');
requireToConst:
prefix: req
body: const ${1:packageName} = require('${1:package}');$0
description: Require a package to const
exportDefault:
prefix: exp
description: export default ***
body: export default $0;
destructingObject:
prefix: dob
body: const {${2:propertyName}} = ${1:objectToDestruct};
description: Creates and assigns a local variable using object destructing
destructingArray:
prefix: dar
body: const [${2:propertyName}] = ${1:arrayToDestruct};
description: Creates and assigns a local variable using array destructing
exportDestructing:
prefix: exd
description: export {***}
body: export { $0 };
consolelog:
prefix: clg
description: console.log()
body: console.log(${1:object});
forEach:
body: "${1:array}.forEach(${2:currentItem} => {\t${0}})"
description: Creates a forEach statement in ES7 syntax
prefix: fre
forIn:
body: "for(let ${1:item} in ${2:object}) {\t${0}}"
description: Iterating over property values of iterable objects
prefix: fin
forOf:
body: "for(let ${1:item} of ${2:object}) {\t${0}}"
description: Iterating over property names of iterable objects
prefix: fof
namedFunction:
body: "const ${1:name} = (${2:params}) => {\t${3}}"
description: Creates a named function in ES7 syntax
prefix: nfn
anonymousFunction:
body: "(${1:params}) => {\t${2}}"
description: Creates an anonymous function in ES7 syntax
prefix: anfn
method:
body: "${1:methodName} = (${2:params}) => {\t${0}}"
description: Creates a method inside a class in ES7 syntax
prefix: met
promise:
body: "return new Promise((resolve, reject) => {\t${1}})"
description: Creates and returns a new Promise in the standard ES7 syntax
prefix: prom
thenCatch:
prefix: thenc
body: .then((${1:result}) => {\n\t${2}\n}).catch((${3:err}) => {\n\t${4}\n});
description: Add the .then and .catch methods to handle promises
setInterval:
prefix: sti
body: setInterval(() => {\n\t${2}\n}, ${0:intervalInms});
description: Executes the given function at specified intervals in ES6 syntax
setTimeout:
prefix: sto
body: setTimeout(() => {\n\t${2}\n}, ${1:delayInms});
description: Executes the given function after the specified delay in ES6 syntax