Skip to content
This repository has been archived by the owner on Nov 28, 2023. It is now read-only.

feat: Conditional Fetching #39

Open
HaNdTriX opened this issue Oct 20, 2022 · 0 comments
Open

feat: Conditional Fetching #39

HaNdTriX opened this issue Oct 20, 2022 · 0 comments

Comments

@HaNdTriX
Copy link
Contributor

HaNdTriX commented Oct 20, 2022

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 (
    ...
  );
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant