Skip to content

Answer:50 - signal-bug-in-effect #1305

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

HichamGuessab
Copy link

Answer:50

  1. Need someone to know if I am well understanding and for deep dive question.
  2. Any clue for the computed way ?

Thank you !

@github-actions github-actions bot added 50 bug signal effect: effect not triggered answer answer labels Apr 17, 2025
@StormLx
Copy link

StormLx commented Apr 18, 2025

  • I would use 3 separate effects too.
  • I wouldn't use a ternary with undefined.
  • The computed mustn't be used for side effects (such as showing an alert) but to compute a new value when a signal updates. So what I would do is a computed named "shouldDisplayAlert" that would calculate when we should show the alert, and use that computed in a single effect to display the alert when the value is TRUE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
50 bug signal effect: effect not triggered answer answer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants