I'm facing a situation where I need to reset a state without having to create an initial state again. Here's the dilemma:
initialState: {
id: '',
name: '',
index: ''
},
state: {
id: '',
name: '',
index: ''
}
Typically, resetting the state would look like this:
resetForm () {
this.state = this.initialState
}
Is there a way to achieve this without explicitly declaring an initialState variable?