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

Commit

Permalink
feat: add streaming/cancellable API (#34)
Browse files Browse the repository at this point in the history
Upgrades to the latest interface-datastore which includes streaming APIs and passing AbortControllers.

Uses the new Adapter class to implement these with minimal code changes.
  • Loading branch information
achingbrain authored May 7, 2020
1 parent 60d14c0 commit 6bfb51a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@
},
"homepage": "https://github.com/ipfs/js-datastore-level#readme",
"dependencies": {
"datastore-core": "^1.0.0",
"interface-datastore": "^0.8.0",
"datastore-core": "^1.1.0",
"interface-datastore": "^1.0.2",
"level": "^5.0.1"
},
"devDependencies": {
"aegir": "^21.9.0",
"aegir": "^22.0.0",
"chai": "^4.2.0",
"cids": "^0.8.0",
"dirty-chai": "^2.0.1",
Expand Down
12 changes: 9 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
'use strict'

const { Key, Errors, utils } = require('interface-datastore')
const { filter, map, take, sortAll } = utils
const {
Key, Errors, Adapter,
utils: {
filter, map, take, sortAll
}
} = require('interface-datastore')

/**
* A datastore backed by leveldb.
*/
class LevelDatastore {
class LevelDatastore extends Adapter {
constructor (path, opts) {
super()

let database

if (opts && opts.db) {
Expand Down

0 comments on commit 6bfb51a

Please sign in to comment.