Skip to Content
만들면서 배우는 프로그레시브 웹 앱: 사용자 경험을 극대화하는 차세대 웹 앱 기술
book

만들면서 배우는 프로그레시브 웹 앱: 사용자 경험을 극대화하는 차세대 웹 앱 기술

by 한민주, 양찬석, 탈 아터
April 2019
Beginner to intermediate
368 pages
7h 18m
Korean
Hanbit Media, Inc.
Content preview from 만들면서 배우는 프로그레시브 웹 앱: 사용자 경험을 극대화하는 차세대 웹 앱 기술
8 메시지를 통한 서비스 워커와 페이지 간의 커뮤니케이션
- 233
chapter
8
메시지를 통한 서비스 워커와
페이지 간의 커뮤니케이션
페이지에서 서비스 워커로 더 많은 로직을 옮길수록, 둘 사이에는 더 많은 커뮤니
케이션이 필요합니다.
7
장에서는 네트워크 요청과 같은 중요한 이벤트를 휘발성 페이지에서 서비스 워
커로 옮겨 어떻게 앱을 더 안정적으로 만들 수 있는지 살펴보았습니다. 하지만 종
종 이러한 작업 결과를 기반으로 페이지를 다시 업데이트해야 할 수 있습니다. 예
를 들어
217
페이지 ‘앱에 백그라운드 동기화 추가하기’에서는 신규 등록을 위한
코드를 서비스 워커에서 실행되는
background sync
이벤트로 옮겨보았습니
다. 이 이벤트는 서버를 호출하고 업데이트된 예약 상세내용을 포함하는
JSON
파일을 받습니다.
IndexedDB
의 예약 상세내용을 업데이트하기 위해
JSON
파일의 데이터를 사용하지만, 서비스 워커가 윈도우에 접근할 수 없기 때문에,
DOM
에 예약 상세내용을 업데이트 할 수 없습니다. 대신 페이지는 새로운 예
약 상태를 확인하기 위해 몇 초마다 네트워크를 체크하고
DOM
을 업데이트하는
setInterval()
에 의존합니다. 만일
sync
이벤트에서 업데이트된 예약 상세내
용을 받는 즉시 페이지로 전송할 수 있다면
DOM
을 즉시 업데이트하고 ...
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.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

파이썬으로 웹 크롤러 만들기: 초간단 나만의 웹 크롤러로 원하는 데이터 가져오는 방법

파이썬으로 웹 크롤러 만들기: 초간단 나만의 웹 크롤러로 원하는 데이터 가져오는 방법

한선용, 라이언 미첼

Publisher Resources

ISBN: 9791162248737