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

166
Views
Does Vue have something similar to Svelte's destiny operator?

This one-liner in svelte will execute anytime the value of someVar changes.

$: console.log({someVar});

Svelte calls this a reactive declaration, the code after the $ label, what Svelte calls the "destiny operator" will be executed whenever any variables referenced within it change.

This is really useful for debugging. Does Vue have something similar?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The most similar API would probably be watchEffect():

watchEffect(() => console.log(someVar.value))

Example:

<script setup>
import { ref, watchEffect } from 'vue'
const someVar = ref(0)
watchEffect(() => console.log(someVar.value))
</script>

<template>
  <button @click="someVar++">Increment {{ someVar }}</button>
</template>

demo

about 4 years ago · Juan Pablo Isaza Report
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!