Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/w3cj/use-x
Practice implementing custom react hooks with full test suites and examples.
https://github.com/w3cj/use-x
check-list custom-hooks hooks react react-fetch react-fetch-hooks react-test-suite test-suite usefetch
Last synced: 20 days ago
JSON representation
Practice implementing custom react hooks with full test suites and examples.
- Host: GitHub
- URL: https://github.com/w3cj/use-x
- Owner: w3cj
- License: mit
- Created: 2024-10-16T21:52:27.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2024-10-17T14:23:16.000Z (about 2 months ago)
- Last Synced: 2024-11-07T01:48:43.852Z (about 1 month ago)
- Topics: check-list, custom-hooks, hooks, react, react-fetch, react-fetch-hooks, react-test-suite, test-suite, usefetch
- Language: TypeScript
- Homepage: https://www.youtube.com/watch?v=GDXsuoisg60
- Size: 68.4 KB
- Stars: 12
- Watchers: 1
- Forks: 3
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - w3cj/use-x - Practice implementing custom react hooks with full test suites and examples. (TypeScript)
README
# use-x
Practice implementing custom react hooks with full test suites and examples.
## Hooks
- [useFetch](./src/use-fetch)
- Manage the error, loading and data state of `fetch`## Setup
Install dependencies
```sh
pnpm i
```## Enable tests
All tests are skipped by default. To enable a test, remove `.skip`
```diff
- it.skip("should test the hook", async () => {
+ it("should test the hook", async () => {
// codes here
});
```Run all tests
```sh
pnpm test
```Run a specific test suite
```sh
pnpm test ./src/path/to/test/file/use-hook.test.ts
```