saveState = (newState) => {
    try {
        newState && localStorage.setItem(
            DEMO_ITEM_NAME,
            JSON.stringify(newState)
        );
    } catch (e) {
        console.error('Failed to save state:', e);
    }
}
Save new state in localstorage
@param {typeof defaultState} newState