Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

222
Views
Should I use action or mutation to update my state

I'm working on a small application using Vuex I would like to change my state data, my question is should I do that directly in my axios calls by calling a Vuex action or Vuex mutation ?

this is my code :

axios.get('http://test.com').then(response => {
            // should I use action like that  
            this.$store.dispatch('updateTableData', response.data)
            // Or mutation
            this.$store.commit('UPDATE_TABLE_DATA', response);
        });

which one should I use normally Thank you

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!