Last active
June 7, 2017 01:03
-
-
Save choonkending/532932f8cd3a1a2256b45e085beaca59 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const getUserFromLocalStorage = keyName => { | |
const str = localStorage.getItem(keyName); | |
try { | |
return JSON.parse(str); | |
} catch (e) { | |
return "Invalid or Corrupted User Data"; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment