We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ec0c2fc commit 0f93c20Copy full SHA for 0f93c20
1 file changed
index.js
@@ -23,7 +23,12 @@ if (!hyperdb.createReadStream) {
23
function Graph (storage, key, opts) {
24
if (!(this instanceof Graph)) return new Graph(storage, key, opts)
25
events.EventEmitter.call(this)
26
- this.db = hyperdb(storage, key, opts)
+ if (opts.db) {
27
+ this.db = opts.db
28
+ }
29
+ else {
30
+ this.db = hyperdb(storage, key, opts)
31
32
33
this.db.on('error', (e) => {
34
this.emit('error', e)
0 commit comments