jakearchibald / idb

IndexedDB, but with promises
https://www.npmjs.com/package/idb
ISC License
6.31k stars 356 forks source link

db.get is not a function and other methods #149

Closed Taisyon closed 4 years ago

Taisyon commented 4 years ago
<script type="module">
    import { openDB } from 'https://unpkg.com/idb?module';
    const db = openDB('my', 1);
    alert(db.get('price', 1));
    const store = db.transaction('price').objectStore('price');
    const value = store.get(35);
    alert(value);
</script>

As you can see, I did the code according to the instructions, but in any modern browser it writes an error

jakearchibald commented 4 years ago

This isn't according to the instructions. Many of those methods return promises.