S
SolidJS•10mo ago
ephons

Usage of createResource and correct access to the result

I'm not really sure why latest can be undefined here. Am I missing something or is it TS being TS?
No description
2 Replies
foolswisdom
foolswisdom•10mo ago
Because until the promise resolves, the value is undefined The resource needs to have some value in the meantime, after all Although you are using a Show, it's impossible to tell TS that the return type of a function can be narrowed So I guess you could say this is a ts problem You could try to use the callback version of Show, that should let narrow the type by passing the value as the callback param
ephons
ephons•10mo ago
Argh! So annoying 😢
Want results from more Discord servers?
Add your server