From 90d7b52987475c1c83012b74d71710add3b2647f Mon Sep 17 00:00:00 2001 From: Daniel Ternyak Date: Wed, 5 Jul 2017 17:16:32 -0500 Subject: [PATCH] Fix flow --- common/index.jsx | 1 - common/utils/localStorage.js | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/common/index.jsx b/common/index.jsx index 7dbe85b8..004c5402 100644 --- a/common/index.jsx +++ b/common/index.jsx @@ -1,4 +1,3 @@ -//flow import React from 'react'; import { render } from 'react-dom'; import { syncHistoryWithStore, routerMiddleware } from 'react-router-redux'; diff --git a/common/utils/localStorage.js b/common/utils/localStorage.js index 392074bf..3f851d6f 100644 --- a/common/utils/localStorage.js +++ b/common/utils/localStorage.js @@ -1,3 +1,4 @@ +// @flow export const REDUX_STATE = 'REDUX_STATE'; export const loadState = () => { @@ -12,7 +13,7 @@ export const loadState = () => { } }; -export const saveState = state => { +export const saveState = (state: Object) => { try { const serializedState = JSON.stringify(state); localStorage.setItem(REDUX_STATE, serializedState); @@ -26,8 +27,7 @@ export const loadStatePropertyOrEmptyObject = (key: string): Object => { if (localStorageState) { if (localStorageState.hasOwnProperty(key)) { return localStorageState[key]; - } else { - return {}; } } + return {}; };