-
Notifications
You must be signed in to change notification settings - Fork 171
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
refact/create micro app #479
Conversation
maoxiaoke
commented
Dec 8, 2021
- refact createMicroApp api
src/apps.ts
Outdated
|
||
// Merge global configuration | ||
const cfgs = globalConfiguration; | ||
Object.keys(configuration || {}).forEach((key) => { |
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.
注释下这里引用赋值的原因,也可以考虑重构成 单独的 Configuration 类,提供 get 和 set 的方法
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.
这里预期不是引用赋值,虽然老代码是引用赋值,但不是预期行为
src/apps.ts
Outdated
|
||
const appConfig = getAppConfig(appName); | ||
|
||
if (!(appConfig && appName)) { |
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.
!appConfg || !appName 可能会更清晰点,不存在 appConfig 或者 appName 的时候直接报错