Skip to content
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

Fetch API を使う #118

Merged
merged 11 commits into from
Jan 26, 2020
Merged

Fetch API を使う #118

merged 11 commits into from
Jan 26, 2020

Conversation

blhsrwznrghfzpr
Copy link
Collaborator

XMLHttpRequest の処理を Fetch API で書き換えました

副産物として、まとめからのインポート処理が非同期で読み込まれるようになりました。
読み込み時間は前よりかは時間がかからなくなったと思います

refs #3

件数が多いまとめを見るときは初期ロードに時間がかかる

テストのときに使ってたサンプルまとめ
https://qithub-bot.github.io/mastogetter/p.html?i=https://qiitadon.com&t=0_1,0_2,0_3,0_4,0_5,0_6,0_7,0_8,0_9,0_a,0_b,0_c,0_d,0_e,0_f,0_g,0_h,0_i,0_j,0_k,0_l,0_m,0_n,0_o,0_p,0_q,0_r,0_s,0_t,0_u,0_v,0_w,0_x,0_y,0_z,0_10

@blhsrwznrghfzpr blhsrwznrghfzpr added the enhancement New feature or request label Jan 25, 2020
@blhsrwznrghfzpr blhsrwznrghfzpr self-assigned this Jan 25, 2020
js/common.js Outdated
}
} catch (err) {
console.error(err);
return Promise.resolve(null); // Promise.all() が reject されないように resolve している
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

単にnullを返せませんでしたっけ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

( reject ではなく) resolve してるんだぞ、ということを明示的に主張したかったのでこう書きました。
冗長と感じるなら消します

@yumetodo
Copy link
Contributor

#119 を見てください

@blhsrwznrghfzpr blhsrwznrghfzpr merged commit d3470dd into master Jan 26, 2020
@blhsrwznrghfzpr blhsrwznrghfzpr deleted the refactor/use-fetch-api branch January 26, 2020 09:39
@KEINOS
Copy link
Member

KEINOS commented Jan 26, 2020

🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants