Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 3d94b1e

Browse files
kbilkisDamian Sznajder
authored and
Damian Sznajder
committed
Add 'bnd' for React method binding
1 parent 57dee8c commit 3d94b1e

File tree

4 files changed

+39
-38
lines changed

4 files changed

+39
-38
lines changed

‎CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All info about changes
44

55
# Released
66

7+
[1.5.2] - 2018年04月30日
8+
9+
* Add `bnd`.
10+
711
[1.5.1] - 2018年04月20日
812

913
* Add `gdsfp`, `gsbu`, `rcontext`, `cref`, `fref` from React 16.3, deprecations for `cwup` `cwm` `cwr`.

‎README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ Every space inside `{ }` and `( )` means that this is pushed into next line :)
7676
| `rcontext→` | `const ${1:contextName} = React.createContext()` |
7777
| `cref→` | `this.${1:refName}Ref = React.createRef()` |
7878
| `fref→` | `const ref = React.createRef()` |
79+
| `bnd→` | `this.methodName = this.methodName.bind(this)` |
7980

8081
## React Native
8182

‎package.json

Lines changed: 29 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,30 @@
11
{
2-
"name": "es7-react-js-snippets",
3-
"displayName": "ES7 React/Redux/GraphQL/React-Native snippets",
4-
"description": "Simple extensions for React, Redux and Graphql in JS with ES7 syntax",
5-
"version": "1.5.1",
6-
"publisher": "dsznajder",
7-
"icon": "images/logo.png",
8-
"keywords": [
9-
"snippets",
10-
"react",
11-
"redux",
12-
"react-native",
13-
"graphql",
14-
"javascript"
15-
],
16-
"engines": {
17-
"vscode": "^1.13.0"
18-
},
19-
"license": "SEE LICENSE",
20-
"repository": {
21-
"type": "git",
22-
"url": "https://github.com/dsznajder/vscode-es7-javascript-react-snippets"
23-
},
24-
"categories": [
25-
"Snippets"
26-
],
27-
"contributes": {
28-
"snippets": [
29-
{
30-
"language": "javascript",
31-
"path": "./snippets/snippets.json"
32-
},
33-
{
34-
"language": "javascriptreact",
35-
"path": "./snippets/snippets.json"
36-
}
37-
]
38-
}
39-
}
2+
"name": "es7-react-js-snippets",
3+
"displayName": "ES7 React/Redux/GraphQL/React-Native snippets",
4+
"description": "Simple extensions for React, Redux and Graphql in JS with ES7 syntax",
5+
"version": "1.5.2",
6+
"publisher": "dsznajder",
7+
"icon": "images/logo.png",
8+
"keywords": ["snippets", "react", "redux", "react-native", "graphql", "javascript"],
9+
"engines": {
10+
"vscode": "^1.13.0"
11+
},
12+
"license": "SEE LICENSE",
13+
"repository": {
14+
"type": "git",
15+
"url": "https://github.com/dsznajder/vscode-es7-javascript-react-snippets"
16+
},
17+
"categories": ["Snippets"],
18+
"contributes": {
19+
"snippets": [
20+
{
21+
"language": "javascript",
22+
"path": "./snippets/snippets.json"
23+
},
24+
{
25+
"language": "javascriptreact",
26+
"path": "./snippets/snippets.json"
27+
}
28+
]
29+
}
30+
}

‎snippets/snippets.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,11 @@
561561
"prefix": "state",
562562
"body": "this.state.0ドル"
563563
},
564+
"bindThis": {
565+
"prefix": "bnd",
566+
"body": "this.${1:methodName} = this.${1:methodName}.bind(this)0ドル",
567+
"description": "Binds this to a method"
568+
},
564569
// ==============================================================================================
565570
// Redux
566571
"reduxAction": {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /