S
SolidJS•13mo 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•13mo 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
ephonsOP•13mo ago
Argh! So annoying 😢
Want results from more Discord servers?
Add your server