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
async/await
Search
Eduardo Quagliato
February 21, 2017
Programming
0
69
async/await
A presentation about async/await focused on Node.js.
Eduardo Quagliato
February 21, 2017
Tweet
Share
More Decks by Eduardo Quagliato
See All by Eduardo Quagliato
nodejsCWB[1]
quagliato
0
30
nodejsCWB[0]
quagliato
0
16
CfCWB Workshop - MEAN
quagliato
0
73
Explosão Controlada
quagliato
1
300
Other Decks in Programming
See All in Programming
MetricKitで予期せぬ終了を検知する話 / Detect unexpected termination with MetricKit
nekowen
1
180
Elm 0.19.0 Changes
bkuhlmann
0
490
Apache Hive 4 on Treasure Data
ryukobayashi
0
100
R言語の環境構築と基礎 Tokyo.R 112
bob3bob3
0
260
Semantic search with Django and pgvector
pauloxnet
0
240
StoreKit2によるiOSのアプリ内課金のリニューアル
kangnux
0
110
Rethinking UI building strategies @ SFI 2024
letelete
0
270
PostmanでAPIの動作確認が楽になった話
h455h1
0
170
Git Lint
bkuhlmann
4
750
ONE WEDGE_company_guide
1wedge_one
0
470
新宿ダンジョンを可視化してみた
satoshi7190
2
240
Scalable Customer Journey Orchestration (CJO)
lewuathe
0
100
Featured
See All Featured
Bash Introduction
62gerente
604
210k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
155
14k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
25
2.3k
Navigating Team Friction
lara
178
13k
How STYLIGHT went responsive
nonsquared
92
4.8k
Optimizing for Happiness
mojombo
370
69k
Building Effective Engineering Teams - LeadDev
addyosmani
28
1.8k
Done Done
chrislema
178
15k
Large-scale JavaScript Application Architecture
addyosmani
504
110k
In The Pink: A Labor of Love
frogandcode
138
21k
Writing Fast Ruby
sferik
621
60k
Git: the NoSQL Database
bkeepers
PRO
422
63k
Transcript
async/await
WTF?
async/await são funções especificadas a partir do ES8/ECMAScript2017 para processamento
assíncrono.
O que é ES8/EMCAScript2017???
ECMA International = European Computer Manufactorers Association
ECMAScript é uma linguagem de script especificada pela ECMA baseada
na especificação ECMA-262 http://www.ecma-international.org/ecma-262/6.0/
ECMAScript foi baseada em JavaScript mas hoje JavaScript acompanha a
especificação da ECMA
Então, ES8/ECMAScript2017 é a 8ª especificação da ECMAScript, a ser
lançada em 2017
ES8/ECMAScript2017 ainda em implementação por navegadores motores, ambientes de execução
Voltando pro async/await...
2 novas palavras reservadas:
async
await
Mas antes...
Promise
Exemplo roubado de https://braziljs.org/blog/promises-no-javascript/
async • Como o próprio nome já diz, é uma
função assíncrona • Deve obrigatoriamente retornar uma Promise
await • “wait” = “esperar” • await só pode esperar
função assíncrona (async)
E ajudam a evitar isso...
… e isso.
Quer mais? • http://bit.ly/AsyncAwaitLink1 • http://bit.ly/AsyncAwaitLink2 • http://bit.ly/AsyncAwaitLink3 • http://bit.ly/AsyncAwaitLink4
Muito obrigado! dúvidas?
[email protected]