-
Notifications
You must be signed in to change notification settings - Fork 45
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: storage 抽为同构方案 & httpClient 重构支持流式 & configManager 抽离 #232
Conversation
...headers, | ||
..._config.headers, | ||
}, | ||
..._config, |
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.
这里的 _config.headers 不会覆盖 headers 么?,那上面的 ...headers
就无效了吧
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.
会覆盖,下个 pr 优化。这块已经提了
Accept: 'application/json', | ||
...config.headers, | ||
}; | ||
config.body = JSON.stringify(_config.data); |
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.
这里的 data 为会为空么
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.
有可能,看使用方,不过为空好像也没有问题
const readableStreamConfig = { | ||
start: (controller: ReadableStreamDefaultController) => { | ||
const read = () => { | ||
reader |
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.
我记得 for...of 操作可读性会更好
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.
这块我看看后面把他改成 for of
}); | ||
} | ||
|
||
if (e.code === 20 && e.name === 'AbortError') { |
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.
code 为啥会是 20,好奇怪的定义
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.
这块 code 试 debug 对时候测出来的, AbortError 的 code 是 20 ,估计是内部设置的吧。当时为了保险,加了一个 code 和 name 判断 AbortError
🤔 这个变动的性质是?
🔗 相关 Issue