1.0.4 • Published 4 months ago

kore-query v1.0.4

Weekly downloads
-
License
ISC
Repository
-
Last release
4 months ago

Kore Query

GitHub contributors GitHub forks GitHub Repo stars GitHub issues LinkedIn

License: MIT

Kore-Query

A library built on @tanstack/react-query to increase ease of use, control, and efficiency

Github Repo


Contents


About

Kore-Query comes with custom hooks like mutations, prefetch, queries. It also provides custom providers, and a client built on Axios to use with React Query with Suspension.


Installation

npm

npm i --save kore-query

yarn

yarn add kore-query

To clone the repo:

git clone https://github.com/koltenfluckiger/kore-query.git


Examples

import {Korios, useKoreQuery, useKoreQueryContext} from "kore-query";
import React, {Suspense} from "react";

function Container({children, ...props}) {
  const dashboards = Korios.asyncerrator({
    url: "/api/dashboards",
    params: {populate: "*"},
    method: "GET",
    options: {withCredentials: true},
  });
  const {data, isLoading, error} = useKoreQuery({
    queryKey: ["dashboard"],
    queryFunc: dashboards,
  });

  if (isLoading) {
    return <div>Loading...</div>;
  } else {
    return <div>{data}</div>;
  }
}

License

License used for this project - MIT


Contributing

To contribute to this application, create a pull request. Here are the steps needed for doing that:

  • Fork the repo
  • Create a feature branch (git checkout -b NAME-HERE)
  • Commit your new feature (git commit -m 'Add some feature')
  • Push your branch (git push)
  • Create a new Pull Request

    Following a code review, your feature will be merged.


Authors and Acknowledgments

Kolten Fluckiger


Contact Information