jwueller
jwueller
SSolidJS
Created by jwueller on 4/29/2023 in #support
Dealing with null checks on resources
I appreciate you taking the time, by the way!
26 replies
SSolidJS
Created by jwueller on 4/29/2023 in #support
Dealing with null checks on resources
One being the type narrowing and control flow being less straightforward, and the other being signaling the 404 to SolidStart.
26 replies
SSolidJS
Created by jwueller on 4/29/2023 in #support
Dealing with null checks on resources
I guess I'm dealing with several issues at once here.
26 replies
SSolidJS
Created by jwueller on 4/29/2023 in #support
Dealing with null checks on resources
If I understand what you're referring to
26 replies
SSolidJS
Created by jwueller on 4/29/2023 in #support
Dealing with null checks on resources
Sure they must have some system to signal the notFound() function call to some component above.
26 replies
SSolidJS
Created by jwueller on 4/29/2023 in #support
Dealing with null checks on resources
It's just TypeScript narrowing the value type after the if, so it knows that there can't be any nulls afterwards.
26 replies
SSolidJS
Created by jwueller on 4/29/2023 in #support
Dealing with null checks on resources
A minimal version might be close, but an equivalent version doesn't seem to be. The Next.js version is trivial and type-safe by default, and the SolidStart version would require adding an indirection like throwing and catching an error specific to that particular use-case.
26 replies
SSolidJS
Created by jwueller on 4/29/2023 in #support
Dealing with null checks on resources
But that would also require me to add a lot of additional code for something that is essentially just a simple if, which makes me very hesitant to do it that way.
26 replies
SSolidJS
Created by jwueller on 4/29/2023 in #support
Dealing with null checks on resources
Yeah, it would definitely have to be something more robust and type-safe than checking error messages.
26 replies
SSolidJS
Created by jwueller on 4/29/2023 in #support
Dealing with null checks on resources
Yeah, I also considered that. My issue with that was that it requires me to create separate logic for converting null responses to errors, and also requires the "not found" error to be distinguishable from other kinds of errors, since it's not the same as an actual crash.
26 replies
SSolidJS
Created by jwueller on 4/29/2023 in #support
Dealing with null checks on resources
A suspense could certainly help when I actually go and render the tag page, though.
26 replies
SSolidJS
Created by jwueller on 4/29/2023 in #support
Dealing with null checks on resources
I'm sorry, but I fail to see how this addresses the question. I'm not asking about how to deal with a loading state or doing a fallback.
26 replies