mirror of
https://github.com/orbitdb/orbitdb.git
synced 2025-10-07 22:57:07 +00:00
Add del() to ComposedStorage
This commit is contained in:
@@ -57,6 +57,18 @@ const ComposedStorage = async (storage1, storage2) => {
|
||||
return value
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a value from storage.
|
||||
* @function
|
||||
* @param {string} hash The hash of the value to delete.
|
||||
* @memberof module:Storage.Storage-Composed
|
||||
* @instance
|
||||
*/
|
||||
const del = async (hash) => {
|
||||
await storage1.del(hash)
|
||||
await storage2.del(hash)
|
||||
}
|
||||
|
||||
/**
|
||||
* Iterates over records stored in both storages.
|
||||
* @function
|
||||
@@ -115,6 +127,7 @@ const ComposedStorage = async (storage1, storage2) => {
|
||||
return {
|
||||
put,
|
||||
get,
|
||||
del,
|
||||
iterator,
|
||||
merge,
|
||||
clear,
|
||||
|
||||
Reference in New Issue
Block a user