Skip to content

Commit 4b122f5

Browse files
committed
added mapDispatchToProps snippet.
1 parent 61cc379 commit 4b122f5

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ Enjoy :D
4040
|Prefix|Method|
4141
|-------:|-------|
4242
|`rcredux→`|`React component with Redux`|
43-
|`mapS→`|`mapStateToProps function`|
43+
|`mapSta→`|`mapStateToProps function`|
44+
|`mapDis→`|`mapDispatchToProps constant`|
4445

4546

4647
#Redux

snippets/snippets.cson

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,16 @@ export default class ${1:componentName} extends Component {
6969
"""
7070
# React Redux
7171
'mapStateToProps funtion':
72-
'prefix': 'mapS'
72+
'prefix': 'mapSta'
7373
'body': """const mapStateToProps= state => ({
7474
$1
7575
});
76-
76+
"""
77+
'mapDispatchToProps funtion':
78+
'prefix': 'mapDisp'
79+
'body': """const mapDispatchToProps= {
80+
$1
81+
};
7782
"""
7883

7984
'Component with redux':

0 commit comments

Comments
 (0)