Skip to content

Commit 0c22c9f

Browse files
committed
feat: add unwrap method
1 parent 1e1bdd2 commit 0c22c9f

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

packages/interface-blockstore/src/adapter.js

+4
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,10 @@ class BlockstoreAdapter {
240240

241241
return it
242242
}
243+
244+
unwrap () {
245+
return this
246+
}
243247
}
244248

245249
module.exports = BlockstoreAdapter

packages/interface-datastore/src/adapter.js

+4
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,10 @@ class Adapter {
225225

226226
return it
227227
}
228+
229+
unwrap () {
230+
return this
231+
}
228232
}
229233

230234
module.exports = Adapter

packages/interface-store/src/index.d.ts

+5
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,11 @@ export interface Store<Key, Value> {
172172
* ```
173173
*/
174174
queryKeys: (query: KeyQuery<Key>, options?: Options) => AsyncIterable<Key>
175+
176+
/**
177+
* Where a store wraps another store, return the wrapped store
178+
*/
179+
unwrap: () => Store<Key, Value>
175180
}
176181

177182
export type QueryFilter<Key, Value> = (item: Pair<Key, Value>) => boolean

0 commit comments

Comments
 (0)