Skip to content

Commit 5ea6252

Browse files
committed
fix: log only action changes
1 parent 112ade8 commit 5ea6252

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

apps/signal/51-function-call-effect/src/app/action.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
effect,
55
inject,
66
signal,
7+
untracked,
78
} from '@angular/core';
89
import { FormsModule } from '@angular/forms';
910
import { UserService } from './user.service';
@@ -38,7 +39,8 @@ export class ActionsComponent {
3839

3940
constructor() {
4041
effect(() => {
41-
this.userService.log(this.action() ?? 'No action selected');
42+
const action = this.action() ?? 'No action selected';
43+
untracked(() => this.userService.log(action));
4244
});
4345
}
4446
}

0 commit comments

Comments
 (0)