<gh_stars>0
export const loadState = () => {
    const stateDefault = {
        visibleMenu: 'MENU_UNLOGGED',
        token: ''
    };

    try {
        const serializedState = localStorage.getItem('state');
        if (null === serializedState) {
            return stateDefault;
        }
        return JSON.parse(serializedState);
    } catch (error) {
        return stateDefault;
    }
};

export const saveState = state => {
    try {
        const serializedState = JSON.stringify(state);
        localStorage.setItem('state', serializedState);
    } catch (error) {

    }
};