You don't need to do that.
You can just use state.loading = something and it's already reactive.
But please be aware of this.
state.loading = ture/false is reactive but
state = { loading: true/false } is not reactive and you can lose the reactive variable reference
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkRead more