Skip to content

deepComputed returns a signal instead of a deepSignal when used in withComputed #4775

Answered by rainerhahnekamp
bstaley asked this question in Q&A
Discussion options

You must be logged in to vote

The problem is that you are accessing an entry of a Record which doesn't exist. TypeScript doesn't give you an undefined either and that's why you don't get a compilation error. But during runtime - when deepComputed - hits the undefined you are getting the error.

In your case, I would set a default value for selected or return a default user in deepComputed if it is undefined,.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@bstaley
Comment options

@rainerhahnekamp
Comment options

Answer selected by bstaley
@bstaley
Comment options

@rainerhahnekamp
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants