I'm exploring ways to utilize the spread operator for adding or removing object properties in a manner that preserves reactivity.
Within a Vuex mutation, this code snippet is successful:
Vue.set(state.sportTypes.sports, sportName, sportProperties)
However, I am interested in using the spread operator to achieve the same result and return a new object. How can I accomplish this?
state.sportTypes.sports = {...state.sportTypes.sports, {sportName: sportProperties}}