keyStore is a storage library for javascript. It saves data in key and value pair in indexedDb.It acts as an alternative of localStorage.
- Preserves data type.
- No size limitation.
- Can save any type of data including object or blob storage.
- Asynchronous api and sync data. It means when you will execute two query together query will be executed one after another.
Syntax: KeyStore.set(Key,value,callBack);
Example -
KeyStore.set('form-data',{
Name:'Ujjwal Gupta',
Country:'India',
State:'Odisha',
City:'Bhubaneswar'
});
or with callback
KeyStore.set('hello','world',function(){
});
Syntax: KeyStore.get(Key,callBack);
Example -
KeyStore.get('c',function(result){
console.log(result);
})
Syntax: KeyStore.remove(Key,callBack);
Example-
KeyStore.remove('c');
or with callback
KeyStore.remove('c',function(result){
console.log(result);
})
KeyStore.set('hello','world').
get('hello',function(result){
console.log(result);
}).
remove('hello');