Skip to content

Commit d17c985

Browse files
committed
Small fixes to final example
- Point to bundle.js in dist/ folder - Switch to `import *` for action-reducers
1 parent 36a9e01 commit d17c985

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

final/src/containers/App.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22
import find from 'lodash/find';
33
import isEqual from 'lodash/isEqual';
44

5-
import {addEmail, deleteEmail, getEmails, markRead, markUnread} from '../action-reducers';
5+
import * as actionReducers from '../action-reducers';
66

77
import EmailForm from '../components/EmailForm';
88
import EmailList from '../components/EmailList';
@@ -74,7 +74,7 @@ export default class App extends React.Component {
7474
}
7575

7676
_getUpdateEmails() {
77-
return getEmails()
77+
return actionReducers.getEmails()
7878
.then((emails) => {
7979
// Because `emails` is a different reference from `this.state.emails`,
8080
// the component will unnecessarily re-render even though the contents
@@ -93,7 +93,7 @@ export default class App extends React.Component {
9393
this.setState({selectedEmailId: emailId});
9494

9595
// also mark the email as read
96-
markRead(this.state.emails, emailId)
96+
actionReducers.markRead(this.state.emails, emailId)
9797
// optimistic updating (see _handleFormSubmit for more info)
9898
.then((emails) => this.setState({emails}))
9999

@@ -103,7 +103,7 @@ export default class App extends React.Component {
103103
}
104104

105105
_handleItemDelete(emailId) {
106-
deleteEmail(this.state.emails, emailId)
106+
actionReducers.deleteEmail(this.state.emails, emailId)
107107
// optimistic updating (see _handleFormSubmit for more info)
108108
.then((emails) => this.setState({emails}))
109109

@@ -112,7 +112,7 @@ export default class App extends React.Component {
112112
}
113113

114114
_handleItemMarkUnread(emailId) {
115-
markUnread(this.state.emails, emailId)
115+
actionReducers.markUnread(this.state.emails, emailId)
116116
// optimistic updating (see _handleFormSubmit for more info)
117117
.then((emails) => this.setState({emails}))
118118

@@ -126,7 +126,7 @@ export default class App extends React.Component {
126126
}
127127

128128
_handleFormSubmit(newEmail) {
129-
addEmail(this.state.emails, newEmail)
129+
actionReducers.addEmail(this.state.emails, newEmail)
130130
// if the email was successfully updated, we have to make
131131
// a request to get the new list of emails, but we'll have
132132
// to wait for the response of that request, so let's add to

final/src/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
</head>
88
<body>
99
<div id="app"></div>
10-
<script src="bundle.js"></script>
10+
<script src="dist/bundle.js"></script>
1111
</body>
1212
</html>

0 commit comments

Comments
 (0)