SolidJSS
SolidJSโ€ข4y agoโ€ข
1 reply
Kasper

Resource not being called when componet loads

I have create a resource, that i want to update when the "cursor" is changed. I followed the tutorial, but this dose not load when the componet loads.
const fetchSubjects = async (source: any, { value, refetching }: any) => {
  console.log("fetching subjects", source, value);
  return await await urqlClient().query(GET_SUBJECTS, { after: "", first: 2 }).toPromise();
};

export default function Subjects() {
  const [cursor, setCursor] = createSignal();
  const [subjects] = createResource(cursor, fetchSubjects);

  ....
Was this page helpful?