core-query
v1.0.0
Published
This package simplifies and allows the use of @tanstack/react-query. This package allows you to generate async requests using axios and then using them in your react query hooks to cache the data. THIS IS A WIP, I WILL ADD AND TAKE AWAY FEATURES AS I SEE
Downloads
3
Readme
Kore Query
Kore-Query
A library built on @tanstack/react-query to increase ease of use, control, and efficiency
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 core-query
yarn
yarn add core-query
To clone the repo:
git clone https://github.com/koltenfluckiger/core-query.git
Examples
import {Corios, useCoreQuery, useCoreQueryContext} from "core-query";
import React, {Suspense} from "react";
function Container({children, ...props}) {
const dashboards = Corios.asyncerrator({
url: "/api/dashboards",
params: {populate: "*"},
method: "GET",
options: {withCredentials: true},
});
const {data, isLoading, error} = useCoreQuery({
queryKey: ["dashboard"],
queryFunc: dashboards,
});
if (isLoading) {
return <div>Loading...</div>;
} else {
return <div>{data}</div>;
}
}
License
License used for this project - MIT
- For more information on license types, please reference this website for additional licensing information - https: //choosealicense.com/.
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
- GitHub Username: koltenfluckiger
- GitHub Email: [email protected]
- Github Repo