Comments (2)
If I look at the most depended on packages in npm, they all have a default export. I can't find any packages that feel like perfect comparisons to this API on npm, but in our application we have a memory storage module as a fallback for when localStorage fails. I could imagine us replacing window.localStorage
with kv-storage
and doing something like this
// appStorage.js
import { StorageArea } from 'std:kv-storage';
const appStorage = new StorageArea('my-app-storage');
export default appStorage;
// memoryStorage.js
const memoryStorage = new Map();
export default memoryStorage;
import globalStorage from 'std:kv-storage';
import appStorage from './appStorage';
import memoryStorage from './memoryStorage';
I would indeed only expect the default and a StorageArea
named export.
from kv-storage.
This is an interesting proposal! I kind of like them both being on equal footing now, especially since isolated storage areas are so useful, but it's possible we should make it easier to get at the default one.
Do you have examples of the community modules you're thinking of?
I'd personally prefer only one way to do things, so we'd get rid of the storage
named export and instead have the default export be the main storage area. Does that align with your thinking as well?
from kv-storage.
Related Issues (20)
- Use Web IDL, while preserving our goals HOT 6
- "for (const key of storage.keys()) {"
- Cannot store promise-like values HOT 4
- Async parsing like Cloudflare KV API HOT 4
- README incorrectly refer to AngularJS as Angular HOT 1
- Atomic compare-and-swap operation? HOT 5
- Performance concerns HOT 20
- Cross browser compatibility HOT 2
- " })(); " HOT 1
- Can't we use web workers for Async access to LS HOT 4
- Bulk read/write API HOT 7
- Derive from %AsyncIteratorPrototype%? HOT 2
- Handle [[LastKey]] being "not yet started" HOT 2
- Name is unclear HOT 2
- Notate points where the implementation could commit
- [kv-storage] WebAppsWG TPAC F2F agenda (Fukuoka, Sep 19-20 2019) HOT 2
- feature-request - add appendFile-like capability to overcome nedb performance-bottleneck HOT 4
- Range Queries Please 🤓 HOT 1
- Query on implementation status HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kv-storage.