SolidJSS
SolidJSโ€ข3y agoโ€ข
5 replies
Mathieu

Make a Resource depend on another Resource

I would like to have a resource depend (awaiting) on another, like so:
const [resource2] =
  createResource(
    async () => {
      await resource1.promise; // no such property exists
      return fetch();
    });

However I don't have access to the promise in the return of the resource:
https://docs.solidjs.com/references/api-reference/basic-reactivity/createResource
See ResourceReturn doesn't expose the promise/fetcher.
Was this page helpful?