julienetie / db64 Goto Github PK
View Code? Open in Web Editor NEWA Practical IndexedDB API
Home Page: https://julienetie.github.io/db64/examples/input-data/
License: MIT License
A Practical IndexedDB API
Home Page: https://julienetie.github.io/db64/examples/input-data/
License: MIT License
Generate TypeScript definitions and a TS config.
Create an examples directory with an example of db64
Due to the way versioning works it is not possible to modify the schema of a database without creating a new version.
But this can be worked around by:
This API will be in the form of:
Taking one or many store names. And will do nothing if the store exists or does not exist respectively.
This feature will simplify the lifecycle management of Indexeddb.
Create a headless test setup, take influence from the index.html test file.
Common JS not yet supported
Needs a UMD build
Sourcemaps are currently commented out in create-distribution.js because they're not yet referenced in the minified files. This needs fixing.
Delete is necessary for when existing databases in a user's browser needs to be destroyed and recreated.
The only way to add a new database is to increase the version or delete and re-create all the effected databases.
The current workaround to this is:
const req = indexedDB.deleteDatabase('databaseName')
req.onsuccess = () => {
console.log("Deleted database successfully")
}
req.onerror = () => {
console.log("Couldn't delete database")
}
req.onblocked = () => {
console.log("Couldn't delete database due to the operation being blocked")
}
Proposed solutions:
db64.delete('databaseName')
Create a tag and release from the current version.
There are several opportunities to improve refactoring.
Comments can help to encourage users and contributors to understand how it works since it's a fairly simple codebase.
First example, should be?
await db64.create('Games', ['Super Nintendo', 'Gameboy'])
Add minifed ES and CJS distribution files
Show installation examples for es, cjs and script modules in readme.
Could this work with Zustand https://github.com/pmndrs/zustand/blob/main/docs/integrations/persisting-store-data.md#how-can-i-use-a-custom-storage-engine
I see that this library needs initialization so it will probably need some middleware function in order to create the store and then expose the get, set functions in order for Zustand to use them right?
Although has is demonstrated in the readme it needs to be part of the detailed API.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.