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

Commit 6bfb51a

Browse files
authored
feat: add streaming/cancellable API (#34)
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.
1 parent 60d14c0 commit 6bfb51a

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@
3737
},
3838
"homepage": "https://github.com/ipfs/js-datastore-level#readme",
3939
"dependencies": {
40-
"datastore-core": "^1.0.0",
41-
"interface-datastore": "^0.8.0",
40+
"datastore-core": "^1.1.0",
41+
"interface-datastore": "^1.0.2",
4242
"level": "^5.0.1"
4343
},
4444
"devDependencies": {
45-
"aegir": "^21.9.0",
45+
"aegir": "^22.0.0",
4646
"chai": "^4.2.0",
4747
"cids": "^0.8.0",
4848
"dirty-chai": "^2.0.1",

src/index.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
'use strict'
22

3-
const { Key, Errors, utils } = require('interface-datastore')
4-
const { filter, map, take, sortAll } = utils
3+
const {
4+
Key, Errors, Adapter,
5+
utils: {
6+
filter, map, take, sortAll
7+
}
8+
} = require('interface-datastore')
59

610
/**
711
* A datastore backed by leveldb.
812
*/
9-
class LevelDatastore {
13+
class LevelDatastore extends Adapter {
1014
constructor (path, opts) {
15+
super()
16+
1117
let database
1218

1319
if (opts && opts.db) {

0 commit comments

Comments
 (0)