WA-238 Refactor localStorage class allowing load data by key

This commit is contained in:
apanizo 2018-05-21 16:10:05 +02:00
parent 7efcf44961
commit 302fc13613
1 changed files with 4 additions and 3 deletions

View File

@ -1,9 +1,10 @@
// @flow
const SAFES_KEY = 'SAFES'
export const SAFES_KEY = 'SAFES'
export const TX_KEY = 'TX'
export const loadSafes = () => {
export const load = (key: string) => {
try {
const serializedState = localStorage.getItem(SAFES_KEY)
const serializedState = localStorage.getItem(key)
if (serializedState === null) {
return undefined
}