chore: prettier code
This commit is contained in:
parent
a9704b5156
commit
aba2aec0d0
30 changed files with 1533 additions and 734 deletions
|
|
@ -26,9 +26,13 @@ export function get (url, hasBar = false) {
|
|||
return {
|
||||
then: function (success, error = noop) {
|
||||
if (hasBar) {
|
||||
const id = setInterval(_ => progressbar({
|
||||
step: Math.floor(Math.random() * 5 + 1)
|
||||
}), 500)
|
||||
const id = setInterval(
|
||||
_ =>
|
||||
progressbar({
|
||||
step: Math.floor(Math.random() * 5 + 1)
|
||||
}),
|
||||
500
|
||||
)
|
||||
|
||||
on('progress', progressbar)
|
||||
on('loadend', evt => {
|
||||
|
|
@ -42,12 +46,12 @@ export function get (url, hasBar = false) {
|
|||
if (target.status >= 400) {
|
||||
error(target)
|
||||
} else {
|
||||
const result = cache[url] = {
|
||||
const result = (cache[url] = {
|
||||
content: target.response,
|
||||
opt: {
|
||||
updatedAt: xhr.getResponseHeader('last-modified')
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
success(result.content, result.opt)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue