Skip to content

Commit 01d3bee

Browse files
committed
Added redux reducer snippet.
1 parent f1ce048 commit 01d3bee

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,4 @@ Enjoy :D
4444
|-------:|-------|
4545
|`rxconst→`|`export const ${1:constName} = '${1:constName}';`|
4646
|`rxaction→`|`export const ${1:actionName} = ({2:param}) => ({` <br> `type: ${3:type}` <br> `payload: ${4:payload}` <br> `})`|
47+
|`rxreducer→`|`Redux reducer template`|

snippets/snippets.cson

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# You can contact me at https://github.com/papaponmx
33
# https://riosjaime.com or hola@riosjaime.com
44

5+
# v1.9.0
56

67
# JavaScript
78
'.source.js':
@@ -137,3 +138,17 @@ export default connect(mapStateToProps, mapDispatchToProps)(${1:componentName});
137138
138139
}
139140
"""
141+
142+
'.source.js':
143+
'Redux reducer':
144+
'prefix': 'rxreducer'
145+
'body': """export default (state = { }, action) => {
146+
switch (action.type) {
147+
148+
case typeName:
149+
return { ...state }
150+
151+
default:
152+
return state
153+
}
154+
}"""

0 commit comments

Comments
 (0)