-
Notifications
You must be signed in to change notification settings - Fork 0
/
snippets
86 lines (85 loc) · 1.94 KB
/
snippets
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
# Your snippets
#
# Atom snippets allow you to enter a simple prefix in the editor and hit tab to
# expand the prefix into a larger code block with templated values.
#
# You can create a new snippet in this file by typing "snip" and then hitting
# tab.
#
# An example CoffeeScript snippet to expand log to console.log:
#
# '.source.coffee':
# 'Console log':
# 'prefix': 'log'
# 'body': 'console.log $1'
#
# Each scope (e.g. '.source.coffee' above) can only be declared once.
#
# This file uses CoffeeScript Object Notation (CSON).
# If you are unfamiliar with CSON, you can read more about it in the
# Atom Flight Manual:
# http://flight-manual.atom.io/using-atom/sections/basic-customization/#_cson
'.source.js':
'jsx describe - testing':
'prefix': 'describe'
'body': """
describe ('$1', () => {
\t
});
"""
'jsx it function - testing':
'prefix': 'it'
'body': """
it ('$1', () => {
\t
});
"""
'arrow function':
'prefix': 'arrow'
'body': """
=> {
$1
};
"""
'setTimeout':
'prefix': 'setTimeout'
'body': """
setTimeout(() => {
\t
}, $1);
"""
'expect function - testing':
'prefix': 'expect'
'body': 'expect($1);'
'toBe function - testing':
'prefix': 'toBe'
'body': 'toBe($1)'
'done function - testing':
'prefix': 'done'
'body': 'done();'
'getInitialState function':
'prefix': 'getInitialState'
'body': """
getInitialState: function () {
return {
$1
};
},
"""
'createStore - Dev Tools':
'prefix': 'createStore-dev'
'body': """
redux.createStore(reducer, redux.compose(
window.devToolsExtension ? window.devToolsExtension() : f => f
));
"""
'subscribe-redux-store':
'prefix': 'subscribe-redux-store'
'body': """
//subscribe to changes
var unsubscribe = store.subscribe(() => {
var state = store.getState();
$1
});
// unsubscribe();
"""