Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Ajax in React with axios
Search
takanorip
November 04, 2016
Technology
0
690
Ajax in React with axios
takanorip
November 04, 2016
Tweet
Share
More Decks by takanorip
See All by takanorip
デザインエンジニアの延長にデザインマネージャーとしての可能性を探る
takanorip
0
590
Tools for Design Engineers other than LLM in the LLM era
takanorip
1
530
Bulletproof Design System with TypeScript
takanorip
7
4.2k
Eleventy3.0 で始める爆速個人ブログ開発!
takanorip
0
170
Webフォント選定の極意!フォントの基本から最新トレンドまで徹底解説
takanorip
5
950
効果的な管理画面を デザインをするために 避けるべき5つの罠
takanorip
15
7.5k
社内管理画面のデザインもプロダクトデザイン
takanorip
5
2.1k
早わかり W3C Community Group
takanorip
0
510
Ubieとアクセシビリティのこれからを考える
takanorip
0
480
Other Decks in Technology
See All in Technology
GoでもGUIアプリを作りたい!
kworkdev
PRO
0
160
Railsの話をしよう
yahonda
0
170
Introdução a Service Mesh usando o Istio
aeciopires
1
240
Introduction to Sansan for Engineers / エンジニア向け会社紹介
sansan33
PRO
5
43k
私のMCPの使い方
tsubakimoto_s
0
110
AWS UG Grantでグローバル20名に選出されてre:Inventに行く話と、マルチクラウドセキュリティの教科書を執筆した話 / The Story of Being Selected for the AWS UG Grant to Attending re:Invent, and Writing a Multi-Cloud Security Textbook
yuj1osm
1
100
Codexとも仲良く。CodeRabbit CLIの紹介
moongift
PRO
1
260
「れきちず」のこれまでとこれから - 誰にでもわかりやすい歴史地図を目指して / FOSS4G 2025 Japan
hjmkth
1
330
Data Hubグループ 紹介資料
sansan33
PRO
0
2.2k
Kubernetes self-healing of your workload
hwchiu
0
240
初めてのDatabricks Apps開発
taka_aki
1
210
[Codex Meetup Japan #1] Codex-Powered Mobile Apps Development
korodroid
2
1k
Featured
See All Featured
Become a Pro
speakerdeck
PRO
29
5.6k
What's in a price? How to price your products and services
michaelherold
246
12k
YesSQL, Process and Tooling at Scale
rocio
173
14k
Product Roadmaps are Hard
iamctodd
PRO
54
11k
jQuery: Nuts, Bolts and Bling
dougneiner
65
7.9k
Balancing Empowerment & Direction
lara
5
690
A designer walks into a library…
pauljervisheath
209
24k
How to train your dragon (web standard)
notwaldorf
97
6.3k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
920
A better future with KSS
kneath
239
18k
Code Review Best Practice
trishagee
72
19k
Typedesign – Prime Four
hannesfritz
42
2.8k
Transcript
Ajax in React with axios @React&React Native入門者の会
自己紹介 • 大木尊紀(@takanorip) • 株式会社フォーデジットデザイン • フロントエンドエンジニア
今日話すこと
Reactで PromiseなAjaxやってみた という話
前提
React = Library (React ≠ FrameWork)
Ajaxは自前で 実装する必要がある
主な実装方法
jQuery
jQueryによる実装
Ajaxだけで使うには jQueryは重すぎ…
Promise ES2015
Promise • 非同期処理を抽象化したオブジェクト • ES2015で実装された • 書き方が統一されている • 詳しくは→JavaScript Promiseの本
axios
axios • Promise based HTTP client for the browser and
node.js • PromiseベースのHTTPクライアント • IEでもPromise使えるようになる
How To Use
How To Use 1. HFU ͰGETϦΫΤετ 2. σʔλऔಘޙʹUIFO Λ࣮ߦ 3.
Τϥʔͷ߹ DBUDI Λ࣮ߦ
ײ • jQueryʹ͘ΒͯεοΩϦ͔͚ΔͷͰخ͍͠ • JSONPରԠͯ͠ͳ͍ͷͰΫϩευϝΠϯରԠ ͢Δࡍҙ͕ඞཁ (I have decided not
to support JSONP as part of axios.) ということらしい…