-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Conversation
packages/plugin-store/src/module.tsx
Outdated
: storeConfig.initialStates || {}; | ||
const initialData = context ? context.initialData : {}; | ||
|
||
let initialStates = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
分号
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
加了 lint 规则强制检查
packages/plugin-store/src/module.tsx
Outdated
|
||
if (initialData.initialStates) { | ||
initialStates = initialData.initialStates; | ||
} else if (storeConfig.getInitialStates) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
逻辑反了,应该优先用 storeConfig.getInitialStates,防止 br
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
store.getInitialStates
API,统一到getInitialData