Skip to content

Commit

Permalink
feat: add unwrap method
Browse files Browse the repository at this point in the history
  • Loading branch information
achingbrain committed Jun 30, 2021
1 parent 1e1bdd2 commit 0c22c9f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/interface-blockstore/src/adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,10 @@ class BlockstoreAdapter {

return it
}

unwrap () {
return this
}
}

module.exports = BlockstoreAdapter
4 changes: 4 additions & 0 deletions packages/interface-datastore/src/adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,10 @@ class Adapter {

return it
}

unwrap () {
return this
}
}

module.exports = Adapter
5 changes: 5 additions & 0 deletions packages/interface-store/src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,11 @@ export interface Store<Key, Value> {
* ```
*/
queryKeys: (query: KeyQuery<Key>, options?: Options) => AsyncIterable<Key>

/**
* Where a store wraps another store, return the wrapped store
*/
unwrap: () => Store<Key, Value>
}

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

0 comments on commit 0c22c9f

Please sign in to comment.