-
Notifications
You must be signed in to change notification settings - Fork 58
/
typescriptreact.json
87 lines (87 loc) · 1.8 KB
/
typescriptreact.json
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
{
"AppRun Application": {
"prefix": "apprun",
"body": [
"import app from 'apprun';",
"",
"const state = {}",
"",
"const view = (state) => {",
"\treturn <div>",
"\t\t{state}",
"\t</div>",
"}",
"",
"const update = {",
"\t'#': (state) => state",
"}",
"",
"app.start('${0:my-app}', state, view, update);"
],
"description": "AppRun application"
},
"AppRun Component": {
"prefix": "component",
"body": [
"import { app, Component } from 'apprun';",
"",
"export default class extends Component {",
"\tstate = {}",
"",
"\tview = (state) => {",
"\t\treturn <div>",
"\t\t\t{state}",
"\t\t</div>",
"\t}",
"",
"\tupdate = {",
"\t\t'#': (state) => state",
"\t}",
"}"
],
"description": "AppRun application"
},
"AppRun Pure Function Component": {
"prefix": "pfc",
"body": [
"const ${1:Name} = ({ ${2:prop} }) => {",
"\treturn <div>",
"\t\t$0",
"\t</div>",
"}"
],
"description": "AppRun view function"
},
"AppRun Update": {
"prefix": "@on",
"body": [
"@on() ${1:name} = (state, ${2:e}) => {",
"\treturn { ...state, $2 }",
"}"
],
"description": "AppRun update function"
},
"AppRun Log State": {
"prefix": "log",
"body": [
"console.log(${1:state})"
],
"description": "Log state"
},
"AppRun Event Publication": {
"prefix": "run",
"body": [
"{e => ${1|this,app|}.run('$2', e)}"
],
"description": "AppRun publish event"
},
"AppRun Event Subscription": {
"prefix": "on",
"body": [
"app.on('$1', ($2) => {",
"\t$3",
"})"
],
"description": "AppRun subscribe to event"
}
}