SolidJSS
SolidJSโ€ข3y agoโ€ข
2 replies
calvinandhobbes

Does anyone else find it annoying that you can't pass a store as a source signal for createResource?

I have a complex request to pass into the body of a POST request to an API. It has many different nested properties of various depths. I store the request in a solid createStore in the app, so I can efficently set it thoughout my app. But to make this system reactive, so Solid refetches content you have to pull off indvidual signals. I had to build a recursiveFlattener helper function to make it work so if I change any property in the request it refetches. Am I doing something wrong or is that annoying to anyone else. Shouldn't it be something that the compiler can take care of?

Also, maybe a separate post but what's the right way to diff the large response from the resource in the right way? I see helpers like reconcile do I need that? Is there a better example than the docs? What if I needed optimistic updates? What if I need to do an infinite scroll like twitter? Just use solidQuery?
Was this page helpful?