Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: store getInitialStates deprecated #3222

Merged
merged 5 commits into from
May 22, 2020

Conversation

chenbin92
Copy link
Collaborator

  • 废弃 store.getInitialStates API,统一到 getInitialData

: storeConfig.initialStates || {};
const initialData = context ? context.initialData : {};

let initialStates = {}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

分号

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

加了 lint 规则强制检查


if (initialData.initialStates) {
initialStates = initialData.initialStates;
} else if (storeConfig.getInitialStates) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

逻辑反了,应该优先用 storeConfig.getInitialStates,防止 br

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@ClarkXia ClarkXia merged commit b1cb26d into release-next May 22, 2020
@delete-merged-branch delete-merged-branch bot deleted the refactor/store-appConfig branch May 22, 2020 05:58
@chenbin92 chenbin92 mentioned this pull request May 25, 2020
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants