Skip to content

Answer:65#1464

Closed
phhien203 wants to merge 2 commits into
tomalaforge:mainfrom
phhien203:phhien203-signal-forms
Closed

Answer:65#1464
phhien203 wants to merge 2 commits into
tomalaforge:mainfrom
phhien203:phhien203-signal-forms

Conversation

@phhien203
Copy link
Copy Markdown

✅ Challenge Submission Checklist

Start your PR title with: Answer:${challenge_number}

⚠️ Important Notice

If you would like personal feedback or a detailed review, please support the project on GitHub:

You can also submit a PR without sponsorship to:

  • Be listed among the answered challenges, or
  • Receive a review from a community member. 🔥

this.userModel.set(userValue);
} else {
this.userForm.reset({ firstname: '', lastname: '', age: 0, grade: 0 });
this.userModel.set({ firstname: '', lastname: '', age: 0, grade: 0 });
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created this challenge because you can avoid effect thanks to signal forms.
You should look at linkedSignals.

Everything should happen in the creation of userModel

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I updated the code to use linkedSignal.

grade: 0,
};
}
});
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes a lot nicer, isn't it

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, that's right!

const hasValue = this.userResource.hasValue();
const user = this.userResource.value();

if (hasValue && user) {
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @tomalaforge , do you think it's ok to only check if (user) instead of if (hasValue && user)?

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, hasValue do !!user() so it's kind of the same

@tomalaforge tomalaforge removed the to be reviewed PR requests a review label Mar 30, 2026
@github-actions
Copy link
Copy Markdown

This pull request is stale because it has been open for 15 days with no activity.

@github-actions github-actions Bot added the stale label Apr 20, 2026
@github-actions
Copy link
Copy Markdown

This pull request was closed because it has been inactive for 5 days since being marked as stale.

@github-actions github-actions Bot closed this Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

65 answer answer sponsor sponsor the project stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants