News for hackers. Stuff that matters.
Re:Angular v16 by Timon3 on Thursday May 04, 2023 @05:54AM (#35813153)
Will the getter result be cached? If not, it's not a computed property.
Re:Angular v16 by spyke112 on Thursday May 04, 2023 @06:15AM (#35813301)
I’d expect that it’s not cached. But then I would go ahead and call that memoization.
Re:Angular v16 by Timon3 on Friday May 05, 2023 @06:56AM (#35827621)
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.

Re:Angular v16 by nitrammm on Thursday May 04, 2023 @06:03AM (#35813204)
According to what definition?
Re:Angular v16 by geysersam on Thursday May 04, 2023 @07:55AM (#35813974)
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.
Re:Angular v16 by NoNameProvided on Thursday May 04, 2023 @08:54AM (#35814506)
Angular did have it, it is called RxJS.
Re:Angular v16 by Timon3 on Thursday May 04, 2023 @11:56AM (#35817472)
According to the "definition" on the Vue documentation page for computed properties: https://vuejs.org/guide/essentials/computed.html#computed-ca...
Re:Angular v16 by nitrammm on Friday May 05, 2023 @11:37AM (#35830639)
That describe what a computed properly is in the context of Vue.
Re:Angular v16 by Timon3 on Friday May 05, 2023 @12:06PM (#35831188)
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?