S
SolidJS•12mo ago
deluksic

Unresolved createResource doesn't trigger Suspense boundaries?

https://playground.solidjs.com/anonymous/65d5e1a1-df41-47c4-989f-2a0fc0885274 Is it expected that unresolved resource doesn't trigger Suspense boundaries? I would expect my loading screen to come up even if the resource is still waiting for its dependency.
Solid Playground
Quickly discover what the solid compiler will generate from your JSX template
3 Replies
foolswisdom
foolswisdom•12mo ago
I don't know if it's intended behavior, but it's common to set the signal to undefined to prevent the resource from firing. In other words, it's not "waiting to receive the dependency" but rather set to "off" right now
deluksic
deluksic•12mo ago
yeah I do that as well all the time. The surprising part for me is that suspense didn't trigger 🤔 For now I did a simple workaround: instead of undefined, send a symbol NOT_READY and return new Promise(()=>{}) as long as the source is NOT_READY.
foolswisdom
foolswisdom•12mo ago
Yeah, I just thought the framing would help the behavior make more sense
Want results from more Discord servers?
Add your server