@empathyco/x-components
Version:
Empathy X Components
18 lines (15 loc) • 657 B
JavaScript
import { localStorageService } from '../../../../utils/storage.js';
/**
* Default implementation for the
* {@link HistoryQueriesActions.loadHistoryQueriesFromBrowserStorage} action.
*
* @param context - The {@link https://vuex.vuejs.org/guide/actions.html | context} of the actions,
* provided by Vuex.
* @public
*/
const loadHistoryQueriesFromBrowserStorage = ({ commit, getters }) => {
const historyQueries = localStorageService.getItem(getters.storageKey) ?? [];
commit('setHistoryQueries', historyQueries);
};
export { loadHistoryQueriesFromBrowserStorage };
//# sourceMappingURL=load-history-queries-from-browser-storage.action.js.map