Skip to content

Commit

Permalink
Add imports to demos
Browse files Browse the repository at this point in the history
  • Loading branch information
jakearchibald committed Apr 9, 2020
1 parent 01082ad commit 54c8ec7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 54c8ec7

Please sign in to comment.