Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

Commit

Permalink
fix: add options
Browse files Browse the repository at this point in the history
  • Loading branch information
hugomrdias committed Apr 6, 2020
1 parent ef26dc7 commit 2074f00
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,17 @@ const queryIt = async function * (q, store, location) {
}

class IdbDatastore {
constructor (location) {
this.location = location
constructor (location, options = {}) {
this.store = null
this.options = options
this.location = options.prefix + location
this.version = options.version || 1
}

async open () {
const location = this.location
try {
this.store = await openDB(this.location, 1, {
this.store = await openDB(this.location, this.version, {
upgrade (db) {
db.createObjectStore(location)
}
Expand Down

0 comments on commit 2074f00

Please sign in to comment.