https://github.com/tiberriver256/react-query-dependency-injection
Using React Query, React Context, Custom Hooks, and Typescript to make easy-to-use easy-to-test code for consuming an API in your React application
https://github.com/tiberriver256/react-query-dependency-injection
Last synced: 8 months ago
JSON representation
Using React Query, React Context, Custom Hooks, and Typescript to make easy-to-use easy-to-test code for consuming an API in your React application
- Host: GitHub
- URL: https://github.com/tiberriver256/react-query-dependency-injection
- Owner: Tiberriver256
- Created: 2022-03-09T13:36:10.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-03-24T16:15:43.000Z (over 3 years ago)
- Last Synced: 2025-02-14T06:56:54.505Z (8 months ago)
- Language: TypeScript
- Size: 332 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# React Query Dependency Injection
Using React Query, React Context, Custom Hooks, and Typescript to make easy-to-use easy-to-test code for consuming an API in your React application.
## How to use this repo
This repo is a training resource for stepping through how to set up a wrapper
around an API using React Query and dependency injection via React Context.The learning modules are split up into separate git branches. Each module builds
on the learnings of the previous module. The README.md will change for each
branch explaining the concept and will have working code you can inspect.The modules are:
1. `1--dependency-injection` - Learning how to use React Context as a
dependency injection mechanism
2. `2--react-query-custom-hooks` - Covering how to wrap React Query into custom
hooks which make consumption a bit easier.
3. `3--react-query-dependency-injection` - Covering using dependency injection
within React Query custom hooks.## Technology
* [Create-React-App](https://create-react-app.dev/)
* [TypeScript](https://www.typescriptlang.org/)
* [React Query](https://react-query.tanstack.com/)
* [React Context](https://reactjs.org/docs/context.html)
* [Custom Hooks w/ React Context](https://kentcdodds.com/blog/how-to-use-react-context-effectively)