Skip to content

Commit

Permalink
Add new snippet for reducers, bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
matiasdelgado committed Jul 6, 2017
1 parent dd41967 commit e2c80dc
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "uruit-react-snippets",
"displayName": "UruIT React Snippets",
"description": "React Snippets with ECMAScript 6",
"version": "1.1.1",
"version": "1.1.2",
"publisher": "UruIT",
"icon": "images/uruit-logo.png",
"engines": {
Expand Down
20 changes: 20 additions & 0 deletions snippets/snippets.json
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,26 @@
],
"description": "Redux action"
},
"Redux reducer": {
"prefix": "u-reducer",
"body":[
"import { $1 } from './$2.action';",
"",
"const DEFAULT_STATE = { $3 };",
"",
"export function homeReducer(state = DEFAULT_STATE, action) {",
"\tswitch (action.type) {",
"\t\tcase $1:",
"\t\t\treturn {",
"\t\t\t\t$0",
"\t\t\t};",
"\t\tdefault:",
"\t\t\treturn state;",
"\t}",
"}"
],
"description": "Redux reducer"
},
"JSX Element className": {
"prefix": "u-cn",
"body": [
Expand Down

0 comments on commit e2c80dc

Please sign in to comment.