Skip to content

Commit e0bb76a

Browse files
Update cached.ts
1 parent 6f79768 commit e0bb76a

File tree

1 file changed

+3
-4
lines changed
  • packages/@ember/-internals/metal/lib

1 file changed

+3
-4
lines changed

packages/@ember/-internals/metal/lib/cached.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,9 @@ import { createCache, getValue } from '@glimmer/validator';
8484
the subsequent cache invalidations of the `@cached` properties who were
8585
using this `trackedProp`.
8686
87-
As a reminder, do not use this piece of code inside a tracked getter,
88-
as the dependency chain could lead to an infinite loop. Mutating an adjacent
89-
property from a getter is not a good practice anyway, even with a caching
90-
mechanism reducing reruns.
87+
Remember that setting tracked data should only be done during initialization,
88+
or as the result of a user action. Setting tracked data during render
89+
(such as in a getter), is not supported.
9190
9291
@method cached
9392
@static

0 commit comments

Comments
 (0)