use-react-query

import { Provider } from "use-react-query"

Usage no npm install needed!

<script type="module">
  import useReactQuery from 'https://cdn.skypack.dev/use-react-query';
</script>

README

test publish

Http library agnostic lightweight package for making http[s] requests in React with the ability to cache the response

Example

import { Provider } from "use-react-query"

ReactDOM.render(
  <React.StrictMode>
    <Provider>
      <App />
    </Provider>
  </React.StrictMode>,
  document.getElementById("root")
);
const { data, isLoading, isError, refetch } = useQuery({
  queryFn: () => fetchComments(),
  param,
  cache: "commentsApi",
});