Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Will the getter result be cached? If not, it's not a computed property.


I’d expect that it’s not cached. But then I would go ahead and call that memoization.


The concept is actually slightly different. With memoization you store a map from inputs to outputs. A computed property doesn't necessarily do this, it just caches the result of the last computation.

The important part is that a computed property tracks its dependencies and is automatically re-calculated ONLY when necessary. If it behaves differently, it's not equivalent to the concept of a computed property in Vue.


According to what definition?


Isn't that just semantics? Whatever name you give the feature "lazily computed and cached values in the context of web frameworks", previously Angular didn't have them (built in) and now they do.


Angular did have it, it is called RxJS.


According to the "definition" on the Vue documentation page for computed properties: https://vuejs.org/guide/essentials/computed.html#computed-ca...


That describe what a computed properly is in the context of Vue.


Are you aware what comment tree you are in? This whole thing started because GP wrote this:

> For example, this update brings us computed properties, an essential feature for any complex performant web application that was made popular by Vue.js 10 years ago [1].

So obviously the relevant definition is "what the feature does in Vue". What is your issue here?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: