Every line of 'local storage get item' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.
51 getItem(key) { 52 return this.state.data[key]; 53 }
20 getItem(key: string): any { 21 return this.data.get(key); 22 }
4 export function getStorage(key) { 5 const item = getItem(key); 6 try { 7 return JSON.parse(item); 8 } catch (e) { 9 return item; 10 } 11 }
30 getItem (key) { 31 let value = this.storage.getItem(key); 32 33 if (this.options.serialize) { 34 return this._decode(value); 35 } 36 37 return value; 38 }
18 async get (key) { 19 const value = this.store.getItem(key) 20 return typeof value === 'string' ? value : undefined 21 }
196 get(key) { 197 return this.storage.getItem(key); 198 }
34 getLocal(key: string): any { 35 const data = window.localStorage.getItem(key); 36 if (data) { 37 return JSON.parse(data); 38 } else { 39 return null; 40 } 41 }
19 getItem(key, callback){ 20 this.data.get(key, ack => { 21 if(!ack.put){ 22 callback('not_found') 23 } else { 24 callback(null, ack.put) 25 } 26 }) 27 }
134 export function getStorageData(key) { 135 var item = null; 136 try { 137 if (window.localStorage) { 138 item = window.localStorage.getItem(key); 139 } 140 } catch (e) { 141 } 142 return item; 143 }
28 get(key) { 29 return localStorage.getItem(this.prefix + key); 30 }