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

292
Views
How to delay return in Vuex getters?

I am learning Vuex and I am trying to delay the value returned in a getter. Something like this, which does not work:

getters: {
    myGetter: state => {
        if(state.myProperty1 === 'value1'){
            setTimeout(() => {
                return 'resultA'                
            }, 1000);
        }
        else if(state.myProperty1 === 'value2'){
            setTimeout(() => {
                return 'resultB'                
            }, 1000);
        }
    }
}

I am also learning actions and mutations but not sure if this practice is needed here (as I am not changing the state)?

I found similar posts but much more complex and have not been able to understand how to implement this yet.

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!