From 54c8ec7c4d9356e2b31c48385b07e9bb17e8c450 Mon Sep 17 00:00:00 2001 From: Jake Archibald Date: Thu, 9 Apr 2020 07:57:48 +0100 Subject: [PATCH] Add imports to demos --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index c7c71ff..6b8db15 100644 --- a/README.md +++ b/README.md @@ -281,6 +281,8 @@ for await (const cursor of index.iterate('Douglas Adams')) { This is very similar to `localStorage`, but async. If this is _all_ you need, you may be interested in [idb-keyval](https://www.npmjs.com/package/idb-keyval). You can always upgrade to this library later. ```js +import { openDB } from 'idb'; + const dbPromise = openDB('keyval-store', 1, { upgrade(db) { db.createObjectStore('keyval'); @@ -309,6 +311,8 @@ const idbKeyval = { ## Article store ```js +import { openDB } from 'idb/with-async-ittr.js'; + async function demo() { const db = await openDB('Articles', 1, { upgrade(db) {