@@ -2,7 +2,7 @@ import React from 'react';
2
2
import find from 'lodash/find' ;
3
3
import isEqual from 'lodash/isEqual' ;
4
4
5
- import { addEmail , deleteEmail , getEmails , markRead , markUnread } from '../action-reducers' ;
5
+ import * as actionReducers from '../action-reducers' ;
6
6
7
7
import EmailForm from '../components/EmailForm' ;
8
8
import EmailList from '../components/EmailList' ;
@@ -74,7 +74,7 @@ export default class App extends React.Component {
74
74
}
75
75
76
76
_getUpdateEmails ( ) {
77
- return getEmails ( )
77
+ return actionReducers . getEmails ( )
78
78
. then ( ( emails ) => {
79
79
// Because `emails` is a different reference from `this.state.emails`,
80
80
// the component will unnecessarily re-render even though the contents
@@ -93,7 +93,7 @@ export default class App extends React.Component {
93
93
this . setState ( { selectedEmailId : emailId } ) ;
94
94
95
95
// also mark the email as read
96
- markRead ( this . state . emails , emailId )
96
+ actionReducers . markRead ( this . state . emails , emailId )
97
97
// optimistic updating (see _handleFormSubmit for more info)
98
98
. then ( ( emails ) => this . setState ( { emails} ) )
99
99
@@ -103,7 +103,7 @@ export default class App extends React.Component {
103
103
}
104
104
105
105
_handleItemDelete ( emailId ) {
106
- deleteEmail ( this . state . emails , emailId )
106
+ actionReducers . deleteEmail ( this . state . emails , emailId )
107
107
// optimistic updating (see _handleFormSubmit for more info)
108
108
. then ( ( emails ) => this . setState ( { emails} ) )
109
109
@@ -112,7 +112,7 @@ export default class App extends React.Component {
112
112
}
113
113
114
114
_handleItemMarkUnread ( emailId ) {
115
- markUnread ( this . state . emails , emailId )
115
+ actionReducers . markUnread ( this . state . emails , emailId )
116
116
// optimistic updating (see _handleFormSubmit for more info)
117
117
. then ( ( emails ) => this . setState ( { emails} ) )
118
118
@@ -126,7 +126,7 @@ export default class App extends React.Component {
126
126
}
127
127
128
128
_handleFormSubmit ( newEmail ) {
129
- addEmail ( this . state . emails , newEmail )
129
+ actionReducers . addEmail ( this . state . emails , newEmail )
130
130
// if the email was successfully updated, we have to make
131
131
// a request to get the new list of emails, but we'll have
132
132
// to wait for the response of that request, so let's add to
0 commit comments