0

I am working on a logic in my Vue SPA app that pulls data from an API the first time a certain source is called. Since the process would be repeated frequently, I want to store this once pulled data set in my store js.

export default {
  data() 
    return {
      data: ''
    }
  },
  //...
  async mounted() {
    if (store.myFetchedData) {
      this.data = store.myFetchedData;
    } else {
      this.data = await this.getDataFromApi()
      store.myFetchedData = this.data;    
    }
    console.log(this.data)
  },
  // ..
}

On the second run, I expect an object {id: 1, name: "hello world",...} to be output. Instead I get a proxy object.

Proxy { <target>: (3) [...], <handler>: {...} }

What does this proxy object mean? And what do I have to do to change that? Thanks in advance! Max

Max Pattern
  • 1,430
  • 7
  • 18

0 Answers0