https://github.com/dckt/rescript-react-query
Bindings for react-query library
https://github.com/dckt/rescript-react-query
Last synced: 4 months ago
JSON representation
Bindings for react-query library
- Host: GitHub
- URL: https://github.com/dckt/rescript-react-query
- Owner: DCKT
- Created: 2024-02-20T09:34:01.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-21T10:26:55.000Z (over 2 years ago)
- Last Synced: 2025-04-05T16:35:03.649Z (about 1 year ago)
- Language: ReScript
- Size: 75.2 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# rescript-react-query
ReScript bindings for [@tanstack/react-query](https://tanstack.com/query/latest) (targeted version : `^5.22.2`)
## Setup
1. Install the module
```bash
bun install @dck/rescript-react-query
# or
yarn install @dck/rescript-react-query
# or
npm install @dck/rescript-react-query
```
ℹ️ Remember to install `@tanstack/react-query-devtools` module if you want to use `ReactQueryDevtools`.
2. Add it to your `rescript.json` config
```json
{
"bs-dependencies": ["@dck/rescript-react-query"]
}
```
## Usage
The functions can be accessed through `ReactQuery` module.
### [Simple](https://github.com/DCKT/rescript-react-query/blob/main/examples/src/Simple.res)
### [Basic](https://github.com/DCKT/rescript-react-query/blob/main/examples/src/Basic.res)
### [OptimisticUpdate](https://github.com/DCKT/rescript-react-query/blob/main/examples/src/OptimisticUpdate.res)
### [ReactSuspense](https://github.com/DCKT/rescript-react-query/blob/main/examples/src/ReactSuspense.res)
### Basic
## Development
Install deps
```bash
bun install
```
Compiles files
```bash
bun run dev
```
Run tests through examples
```bash
bun run examples
```
Run local webserver
```bash
bun run examples-server
```