diff --git a/lib/use-saved-settings.js b/lib/use-saved-settings.js index 163e5af3..191e9e6c 100644 --- a/lib/use-saved-settings.js +++ b/lib/use-saved-settings.js @@ -1,8 +1,7 @@ import { useCallback, useMemo, useState } from 'haunted'; +import { omit } from '@neovici/cosmoz-utils/lib/object'; -const - storagePrefix = 'omnitable-', - drop = keys => item => Object.fromEntries(Object.entries(item).filter(([key]) => !keys.includes(key))); +const storagePrefix = 'omnitable-'; export const useSavedSettings = (settingsId, settings, setSettings) => { const @@ -28,7 +27,7 @@ export const useSavedSettings = (settingsId, settings, setSettings) => { } try { - localStorage.setItem(storagePrefix + settingsId, JSON.stringify(settings.map(drop(['title', 'minWidth'])))); + localStorage.setItem(storagePrefix + settingsId, JSON.stringify(settings.map(omit(['title', 'minWidth'])))); setSettings([]); setCounter(counter => counter + 1); } catch (e) {