Skip to content

Commit

Permalink
Merge 0f93c20 into ec0c2fc
Browse files Browse the repository at this point in the history
  • Loading branch information
Frando authored Mar 23, 2018
2 parents ec0c2fc + 0f93c20 commit bb46432
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ if (!hyperdb.createReadStream) {
function Graph (storage, key, opts) {
if (!(this instanceof Graph)) return new Graph(storage, key, opts)
events.EventEmitter.call(this)
this.db = hyperdb(storage, key, opts)
if (opts.db) {
this.db = opts.db
}
else {
this.db = hyperdb(storage, key, opts)
}

this.db.on('error', (e) => {
this.emit('error', e)
Expand Down

0 comments on commit bb46432

Please sign in to comment.