1. 11
    Use Computed Properties in Vue to Be More Efficient
    2m 14s

Use Computed Properties in Vue to Be More Efficient

Share this video with your friends

Send Tweet

Computed properties cache the results of the defined calculations and return that result as a prop to be used in the application.

We'll discuss how these computer properties are updated reactively when the underlying data changes. Computed properties come in handy when the operation that you perform is expensive, you'll only need to make the computation when data changes.

Domenic Fiore
~ 2 years ago

I'm a little confused with the example. Is the instructor saying that only when the value of soldOut changes it recalculates? How would it know it changed without recalculating? Sorry, I'm sure it's simple and just flew right above my head.

~ 2 years ago

It seems it is recalculated when the variable that 'soldOut' depends on is updated so in this case, when 'tickets' is updated, the value returned by 'soldOut' is recalculated.