Watchers

8 important questions on Watchers

What is reactive programming?

Programming with asynchronous data streams

What is a stream?

A sequence of ongoing events ordered in time that offer some hooks with which to observe it.

What is a set?

A set is a series of only values (similar to an array), where any particular value can only be inserted once.
  • Higher grades + faster learning
  • Never study anything twice
  • 100% sure, 100% understanding
Discover Study Smart

What is a MAP() ?

A map is a series of keys and values, similar to an object, but with some differences:
  • key/value pairs remember their explicit ordering
  • Perform better in scenarios involving frequent additions and removals
  • Like Set(), you can only add key/value pairs once
  • It has some nice methods, like size, has, set, clear and delete(key)

What does Vuejs do with a data object?

Vue converts it to a proxy

What is the goal of a proxy in Vuejs

  • Performs dependency tracking
  • Change notification when properties are changed or accessed

What are the two level of dependencies for components

  1. First level uses a map and stores dependencies for property
  2. Second level tracks the effects which will be run when the values change

How do we have access to new and old value in a watcher?

watch: {
counter(newValue, oldValue){

console.log(`the counter has changed it was ${oldValue} and it is ${newValue}`)
}
}

The question on the page originate from the summary of the following study material:

  • A unique study and practice tool
  • Never study anything twice again
  • Get the grades you hope for
  • 100% sure, 100% understanding
Remember faster, study better. Scientifically proven.
Trustpilot Logo