chore: prettier code

This commit is contained in:
qingwei.li 2017-09-22 10:07:10 +08:00
commit aba2aec0d0
30 changed files with 1533 additions and 734 deletions

View file

@ -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)
}