UNPKG

@empathyco/x-components

Version:
20 lines (17 loc) 717 B
import { isArrayEmpty } from '../../../../utils/array.js'; /** * Default implementation for the {@link NextQueriesActions.setQueryFromLastHistoryQuery}. * * @param context - The {@link https://vuex.vuejs.org/guide/actions.html | context} of the actions, * provided by Vuex. * @param historyQueries - The current history queries. * @public */ //eslint-disable-next-line max-len const setQueryFromLastHistoryQuery = ({ state, commit }, historyQueries) => { if (!isArrayEmpty(historyQueries) && state.config.loadOnInit) { commit('setQuery', historyQueries[0].query); } }; export { setQueryFromLastHistoryQuery }; //# sourceMappingURL=set-query-from-last-history-query.action.js.map