Fix flow
This commit is contained in:
parent
cbf2fd39d0
commit
90d7b52987
|
@ -1,4 +1,3 @@
|
||||||
//flow
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { render } from 'react-dom';
|
import { render } from 'react-dom';
|
||||||
import { syncHistoryWithStore, routerMiddleware } from 'react-router-redux';
|
import { syncHistoryWithStore, routerMiddleware } from 'react-router-redux';
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
// @flow
|
||||||
export const REDUX_STATE = 'REDUX_STATE';
|
export const REDUX_STATE = 'REDUX_STATE';
|
||||||
|
|
||||||
export const loadState = () => {
|
export const loadState = () => {
|
||||||
|
@ -12,7 +13,7 @@ export const loadState = () => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const saveState = state => {
|
export const saveState = (state: Object) => {
|
||||||
try {
|
try {
|
||||||
const serializedState = JSON.stringify(state);
|
const serializedState = JSON.stringify(state);
|
||||||
localStorage.setItem(REDUX_STATE, serializedState);
|
localStorage.setItem(REDUX_STATE, serializedState);
|
||||||
|
@ -26,8 +27,7 @@ export const loadStatePropertyOrEmptyObject = (key: string): Object => {
|
||||||
if (localStorageState) {
|
if (localStorageState) {
|
||||||
if (localStorageState.hasOwnProperty(key)) {
|
if (localStorageState.hasOwnProperty(key)) {
|
||||||
return localStorageState[key];
|
return localStorageState[key];
|
||||||
} else {
|
}
|
||||||
|
}
|
||||||
return {};
|
return {};
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue