-
-
Notifications
You must be signed in to change notification settings - Fork 311
Closed
Description
Hi thank you this library is already blazingly fast. Im not an expert but Im wondering if adding a simple way to batch multiple reads/writes into a single native operation could further improve performance?
Idea: collapse N JS <-> native calls into 1 do the work natively and coalesce change events
I was thinking it would look something like this when you use it
// Write a bunch of values at once
storage.setMany([
['loggedIn', true],
['user:id', 1234],
['user:name', 'Ada'],
])
// Read multiple keys with one call
const { ['user:id']: id, ['user:name']: name } = storage.getMany(['user:id', 'user:name'])
// Delete multiple keys efficiently
storage.deleteMany(['tmp:1', 'tmp:2', 'tmp:3'])
// Coalesce event emissions & native calls
storage.batch(() => {
storage.setMany([
['features:welcome', true],
['features:newHome', false],
])
storage.deleteMany(['legacy:flag'])
})
lin72h
Metadata
Metadata
Assignees
Labels
No labels