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.
[ Parent
| on HN ]
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.