dvlp / localstoragedb Goto Github PK
View Code? Open in Web Editor NEWIncrease localStorage size 10 times or more! Very easy to use and potentially much faster than native localStorage!
License: MIT License
Increase localStorage size 10 times or more! Very easy to use and potentially much faster than native localStorage!
License: MIT License
I got following issue when running localStorageDB script
index.html:152 Uncaught TypeError: Cannot read property 'transaction' of undefined
Wrap the code where you creating db into function like this:
function foo(callback) {
...
}
In the getValue if !db simply call that function (instead of waiting in timer loop):
function getValue(key, callback) {
if(!db) {
foo(function () {
if(!db) {
throw "some error";
}
getValue(key, callback);
};
return;
}
...
Hi. I would like to have a synchronous version of get
to prevent callback hell. It just needs to return the value instead of a callback.
The properties .v and .k should be specified as ['v'] and ['k'] and {'k': '', 'v': ''} to protect against mangling, as should anything that is stored in any persistent storage. As is, it creates subtle incompatibilities between versions where they may be mangled differently. (Nice functionality overall, thanks)
I've run into troubles as I assumed the .set()
function is a synchronous function. Writing data to disk may take up to a few seconds, so it becomes a huge problem (resulting data loss) when we need to write the data to IndexedDB just before exiting the page.
First off, thanks for the handy script! I've been using it already; quite useful for my purposes.
When I was translating one of my projects from vanilla JS in browser to vanilla TS with Vite, I ran into issues trying to switch this to use via npm using the README instructions.
Specifically getting this error "Could not find a declaration file for module 'localdata'. "
I found I could just port the .js snippet into my project, name it *.mjs and slap an "export default ldb;" on the end and that works, but I was hoping that the npm-based route would work for me. Any thoughts or plans on supporting this?
Thanks in advance.
Database name is str
in the original file and s
in minified version. You can't simply replace minified version with full version after saving some data because you can't reach former data with full version.
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.