Skip to content

Commit eb8975a

Browse files
committed
Improved mapDispatchToProps.
1 parent 9328ca0 commit eb8975a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

snippets/snippets.cson

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ export default class ${1:componentName} extends Component {
7676
"""
7777
'mapDispatchToProps funtion':
7878
'prefix': 'mapDisp'
79-
'body': """const mapDispatchToProps= {
79+
'body': """const mapDispatchToProps = (dispatch) => ({
8080
$1
81-
};
81+
});
8282
"""
8383

8484
'Component with redux':
@@ -102,9 +102,9 @@ const mapStateToProps = (state) => ({
102102
103103
});
104104
105-
const mapDispatchToProps = {
105+
const mapDispatchToProps = (dispatch) => ({
106106
107-
}
107+
})
108108
109109
export default connect(mapStateToProps, mapDispatchToProps)(${1:componentName});
110110
"""

0 commit comments

Comments
 (0)