Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

Awesome Lists containing this project

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
```