Skip to content

Commit ac454d5

Browse files
Fix loading user (#60)
1 parent 9229bc9 commit ac454d5

File tree

1 file changed

+2
-4
lines changed
  • 27-mobx-data/a-sync-to-async/src

1 file changed

+2
-4
lines changed

27-mobx-data/a-sync-to-async/src/Form.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,12 @@ class Form extends Component {
1919
@action
2020
componentDidMount() {
2121
const { store, user, userId } = this.props;
22-
23-
store.user = user;
2422

2523
if (store.fetchUser && userId) {
2624
store
2725
.fetchUser(userId)
28-
.then(userData => (store.user = userData))
29-
.catch(e => console.log(e));
26+
.then(userData => Object.assign(user, userData))
27+
.catch(console.log);
3028
}
3129
}
3230

0 commit comments

Comments
 (0)