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

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

by 한민주, 양찬석, 탈 아터
April 2019
Beginner to intermediate
368 pages
7h 18m
Korean
Hanbit Media, Inc.
Content preview from 만들면서 배우는 프로그레시브 웹 앱: 사용자 경험을 극대화하는 차세대 웹 앱 기술
6 IndexedDB로 로컬에 데이터 저장하기
- 181
새로운 객체로 업데이트 합니다. 이는 객체 저장소에서
readwrite
트랜잭션을
열고 커서로 순회하는 방법으로 처리할 수 있습니다. 함수는
id
와 일치하는 객체
를 찾을 때까지 혹은 마지막 데이터에 도달할 때까지 계속 작업을 반복합니다.
id
와 일치하는 객체를 찾아내면,
cursor
.
update(object)
가 호출되어 업데이트
됩니다. 이 시점에서는, 일단 일치하는 객체를 찾고나면 다음 레코드를 계속 순회
할 필요가 없어지기 때문에
return
을 호출하여 함수를 종료합니다. 이 함수는 다
음과 같이 호출될 수 있습니다.
updateInObjectStore
("
reservations
",
123
,
{
id
:
123
,
nights
:
5
,
guests
:
1
});
마지막 단계는
IndexedDB
에 데이터를 추가하거나 업데이트하고자 할 때 이 두
함수를 호출하는 것입니다.
서버에 새 예약을 추가하기 전에
addToObjectStore()
를 호출하도록
my
-
account
.
js
의
addReservation
를 업데이트합니다. 수정된 함수는 다음과
같습니다.
var addReservation
=
function
(
id
,
arrivalDate
,
nights
,
guests
)
{
var reservationDetails ...
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