next-fetch icon indicating copy to clipboard operation
next-fetch copied to clipboard

feat: Conditional Fetching

Open HaNdTriX opened this issue 2 years ago • 0 comments

Currently there is no declarative way to conditionally fetch data.

Future

This is how an implementation could look like following the swr convention.

import { useTestQuery } from "./api/test.swr";

export default function IndexPage({ id }) {
  const testQuery = useTestQuery(id ? { id } : null);
  return (
    ...
  );
}

HaNdTriX avatar Oct 20 '22 10:10 HaNdTriX