Skip to content

Commit

Permalink
Update size test and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jakearchibald committed Sep 7, 2021
1 parent b3a45b2 commit c129bb0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

This is a super-simple promise-based keyval store implemented with IndexedDB, originally based on [async-storage by Mozilla](https://github.com/mozilla-b2g/gaia/blob/master/shared/js/async_storage.js).

It's small and tree-shakeable. If you only use get/set, the library is ~370 bytes (brotli'd), if you use all methods it's ~560 bytes.
It's small and tree-shakeable. If you only use get/set, the library is ~370 bytes (brotli'd), if you use all methods it's ~570 bytes.

Although this is tiny, it's a little larger than previous versions due to a [massive bug in Safari](https://bugs.webkit.org/show_bug.cgi?id=226547). Hopefully this fix can be removed in the not-too-distant future, when a version of Safari without the bug reaches enough users.

Expand Down Expand Up @@ -183,9 +183,7 @@ Promise.all([del(123), del('hello')])
.catch((err) => console.log('It failed!', err));

// It's faster to do:
delMany([
123, 'hello'
])
delMany([123, 'hello'])
.then(() => console.log('It worked!'))
.catch((err) => console.log('It failed!', err));
```
Expand Down
15 changes: 14 additions & 1 deletion size-tests/all.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,18 @@ import {
setMany,
update,
getMany,
delMany,
} from '../dist';
a(get, set, del, clear, keys, values, entries, setMany, update, getMany);
a(
get,
set,
del,
clear,
keys,
values,
entries,
setMany,
update,
getMany,
delMany,
);

0 comments on commit c129bb0

Please sign in to comment.