Dusty
Dusty
SSolidJS
Created by Dusty on 12/9/2023 in #support
Suspending or creating a resource from a Signal
oh sweet, tested and it works with arrays and primitives out of the box with one unified syntax. Love it.
32 replies
SSolidJS
Created by Dusty on 12/9/2023 in #support
Suspending or creating a resource from a Signal
aaah, it never crossed my mind to subscribe directly to the observable instead of immediately wrapping it in a signal. Thank you so much.
32 replies
SSolidJS
Created by Dusty on 12/9/2023 in #support
Suspending or creating a resource from a Signal
I'm pretty sure it's because I'm resolving store.value now instead of resolve(store) (because I moved the value into the store).
32 replies
SSolidJS
Created by Dusty on 12/9/2023 in #support
Suspending or creating a resource from a Signal
As far as I can see, it's not possible to tell if Dexie's liveQuery is returning undefined because it doesn't know yet vs because there is no response. I assume that the first undefined response is because it doesn't know yet and subsequent ones are ecause it's actually undefined. I tried to hook something up that tracks whether the subscriber has been hit before, but now I've lost reactivity: https://playground.solidjs.com/anonymous/a350db31-2daf-4717-90d6-29a4eed2d8e6
32 replies
SSolidJS
Created by Dusty on 12/9/2023 in #support
Suspending or creating a resource from a Signal
(it renders the fallback until something is added to the db, though)
32 replies
SSolidJS
Created by Dusty on 12/9/2023 in #support
Suspending or creating a resource from a Signal
32 replies
SSolidJS
Created by Dusty on 12/9/2023 in #support
Suspending or creating a resource from a Signal
ah, yes.
32 replies
SSolidJS
Created by Dusty on 12/9/2023 in #support
Suspending or creating a resource from a Signal
Odd... I'm getting a console error "The requested module 'solid-js' does not provide an export named ResourceReturn.
32 replies
SSolidJS
Created by Dusty on 12/9/2023 in #support
Suspending or creating a resource from a Signal
In fact I don't need to trigger off the signal; I've simplified a bit. I'll see if I can get Dexie loading in the playground to demo.
32 replies
SSolidJS
Created by Dusty on 12/9/2023 in #support
Suspending or creating a resource from a Signal
Main thing I don't like is the "single-use" createEffect, and I'm not sure if trigging the promise off the store itself changing is sensible.
32 replies
SSolidJS
Created by Dusty on 12/9/2023 in #support
Suspending or creating a resource from a Signal
not sure I understand.
32 replies
SSolidJS
Created by Dusty on 12/9/2023 in #support
Suspending or creating a resource from a Signal
oooh
32 replies
SSolidJS
Created by Dusty on 12/9/2023 in #support
Suspending or creating a resource from a Signal
well that's nice and readable. 😕 I'll get a gist, one sec.
32 replies
SSolidJS
Created by Dusty on 12/9/2023 in #support
Suspending or creating a resource from a Signal
Hah, I just seconds ago got that working, though it.... lacks elegance: https://gist.github.com/dusty-phillips/dde181bbbe887598e576abd32a429c62
32 replies
SSolidJS
Created by Dusty on 12/9/2023 in #support
Suspending or creating a resource from a Signal
One thing I thought might work was using my signal to trigger the resource by passing it as source to createResource, but the resource then returns undefined until the signal initially fiers, which brings me right back to needing <Show> all over.
32 replies