Skip to Content
자바스크립트 + 리액트 디자인 패턴
book

자바스크립트 + 리액트 디자인 패턴

by 애디 오스마니(Addy Osmani), 윤창식
August 2024
Beginner to intermediate
384 pages
7h 38m
Korean
Hanbit Media, Inc.
Content preview from 자바스크립트 + 리액트 디자인 패턴
216
자바스크립트 + 리액트 디자인 패턴
9.4.2
비동기 반복
비동기 반복
async
Iteration
패턴은
for
-
await
-
of
반복문을 사용하여 비동기 반복 가능 객체를
순회할 수 있도록 합니다.
async function* createAsyncIterable() {
yield 1;
yield 2;
yield 3;
}
async function main() {
for await (const value of createAsyncIterable()) {
console.log(value);
}
}
9.4.3
비동기 에러 처리
비동기 에러 처리
async
Error
Handling
패턴은
try
-
catch
블록을 사용하여 비동기 함수 실행 도중
발생할 수 있는 에러를 처리합니다.
async function main() {
try {
const data = await makeRequest("http://example.com/");
console.log(data);
} catch (error) {
console.error(error);
}
}
9.4.4
비동기 병렬
비동기 병렬
async
Parallelism
패턴은
Promise
.
all
메서드를 사용하여 여러 비동기 작업을 동시
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

AI를 위한 필수 수학

AI를 위한 필수 수학

할라 넬슨
클라우드 엔지니어를 위한 97가지 조언

클라우드 엔지니어를 위한 97가지 조언

Emily Freeman, Nathen Harvey, 정기훈(Jung Ki Hun)

Publisher Resources

ISBN: 9791169212571