Created
January 28, 2021 11:20
-
-
Save bpalij/d27e7d294d8c86b1ffc46d706259b60c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const defaultSnapshot = { | |
token: '', | |
myInnerInfo: { login: '', type: '' }, | |
myDisplayInfo: { login: '', type: '' }, | |
loginInfo: { login: '', type: '' }, | |
loginList: [], | |
loading: false, | |
logined: false, | |
} | |
const User = types | |
.model({ | |
login: '', | |
type: '', | |
}).actions(self => ({ | |
setUserInfo({ login, type }) { | |
self.login = login; | |
self.type = type; | |
} | |
})) | |
const RootStore = types | |
.model({ | |
token: '', | |
myInnerInfo: types.compose(User), // User also did not help | |
myDisplayInfo: types.compose(User), // User also did not help | |
loginInfo: types.compose(User), // User also did not help | |
loginList: types.array(types.string), // User also did not help | |
loading: false, | |
logined: false, | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment