@empathyco/x-components
Version:
Empathy X Components
21 lines (18 loc) • 671 B
JavaScript
import { forEach } from '@empathyco/x-utils';
/**
* Default implementation for the {@link UrlMutations.setParams} mutation.
*
* @param state - Current {@link https://vuex.vuejs.org/guide/state.html | state} of the history
* queries module.
* @param params - The mutation payload with the extra params to set in the state.
* @remarks The change is done using `Vue.set` because we are adding new fields to the state. So
* this is necessary to make them reactive.
* @public
*/
const setParams = (state, params) => {
forEach(params, (key, value) => {
state[key] = value;
});
};
export { setParams };
//# sourceMappingURL=set-params.mutation.js.map