UNPKG

@empathyco/x-components

Version:
21 lines (19 loc) 592 B
/** * Default implementation for the {@link IdentifierResultsActions.saveQuery}. * * @param context - The {@link https://vuex.vuejs.org/guide/actions.html | context} of the actions, * provided by Vuex. * @param query - The query to try to add to the store. * @public */ const saveQuery = ({ commit, getters }, query) => { if (getters.identifierDetectionRegexp.test(query)) { commit('setQuery', query); } else { commit('setQuery', ''); commit('setIdentifierResults', []); } }; export { saveQuery }; //# sourceMappingURL=save-query.action.js.map