abstract-blob-store icon indicating copy to clipboard operation
abstract-blob-store copied to clipboard

Destroying blob stores

Open hackergrrl opened this issue 9 years ago • 2 comments

I really like abstract-blob-store and am using a few different blob stores currently (like fs- and idb-), but I'm a little stumped on the clean-up aspect. For example, fs-blob-store will happily mkdir when you init the module, but there's no general API for deleting the blob store -- just its keys. :disappointed:

This means clean-up must be implementation-specific (since your code will need to know whether to rimraf or to delete the index-db store, etc.) to prevent lingering side-effects of the blob store, such as extra directories hanging around your FS or keys in your IndexedDB store.

This may be best served as a new API method on abstract-blob-store (maybe destroy?). Eager to get your thoughts on this @maxogden and @mafintosh (and anyone else excited about side effect free modules!).

hackergrrl avatar Mar 16 '16 21:03 hackergrrl

I think this would be better left implementation specific, not all stores need cleanup

jnordberg avatar Oct 07 '17 08:10 jnordberg

@jnordberg not all stores accept a key either (think createWriteStream for a content-addressable store --- it'd ignore whatever key input is given). Similarly, stores that don't need it wouldn't need to offer an implementation beyond process.nextTick(cb).

hackergrrl avatar Oct 07 '17 17:10 hackergrrl