Is there a way to skip the createResource query until a parameter is available?

Something similar to Tanstack Query or Apollo, maybe?

  const [collations] = createResource(
    async () => {
      try {
        const response = await hc.collations[":collationId"].$get({
          param: {
            collationId: routeParams!["collationId"],
          },
        });
        return await response?.json();
      } catch (e) {
        return null;
      }
    },
    {
      skip: routeParams?.collationId,
    }
  );
image.png
Was this page helpful?