This media is not supported in your browser
VIEW IN TELEGRAM
π Angular Signals: untracked function
#angular #signals #untrackted
π© > Angular 17
β Article link
#angular #signals #untrackted
untracked allows reading the value of a signal without making such signal a dependency of our computed signal or effect.
In this example, increasing the counter doesnβt trigger a new computation of info. Only a new name does so
name = signal('Angular');
counter = signal(0);
info = computed(
() =>
`The name is now "${this.name()}" and the
counter value was ${untracked(this.counter)} when
the name changed.`
);π© > Angular 17
β Article link
π4