🎉 Initial Commit

This commit is contained in:
Indrajith K L
2019-12-11 18:54:05 +05:30
parent 53e5edb3d9
commit 8988233da8
22 changed files with 14007 additions and 71 deletions

View File

View File

@@ -0,0 +1,16 @@
class Storage{
static get = (key)=>{
if(!key)throw("Storage.get expects a 'key' - 'key' can't be null");
if(!localStorage.getItem(key)) return null;
return localStorage.getItem(key);
}
static set = (key, value)=>{
if(!key||!value){
throw("Storag.set expects a 'key' and a 'value' - 'value' & 'key' can't be null");
}
localStorage.setItem(key, JSON.stringify(value));
}
}
export default Storage;