Skip to content

Commit 596aaf7

Browse files
authored
Update README.md
1 parent edd7dff commit 596aaf7

File tree

1 file changed

+15
-18
lines changed

1 file changed

+15
-18
lines changed

README.md

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
<a target="_blank" href="https://github.com/rescriptbr"> ReScript Brazil Community </a>
99
</p>
1010

11-
> :warning: This repo contains experimental bindings for [@tanstack/query](https://tanstack.com/query/v4) using the experimental optional fields API with ReScript@v10.
12-
If you're looking bindings to the React Query v3 click [here](https://github.com/rescriptbr/react-query/tree/v0.0.2).
11+
> :warning: This repo contains experimental bindings for [@tanstack/query](https://tanstack.com/query/v4) using the new optional fields API.
12+
If you're looking for bindings to the React Query v3 click [here](https://github.com/rescriptbr/react-query/tree/v0.0.2).
1313

1414
## Installation
1515

@@ -33,9 +33,6 @@ Add the package to `bs-dependencies` in your `bsconfig.json`:
3333
## Basic usage
3434

3535
```rescript
36-
/*
37-
* Local bindings for fetch
38-
*/
3936
module Fetch = {
4037
type response
4138
@@ -54,18 +51,15 @@ let fetchTodos = (_): Js.Promise.t<todo> => {
5451
module TodoItem = {
5552
@react.component
5653
let make = () => {
57-
let queryResult = ReactQuery.useQuery(
58-
ReactQuery.queryOptions(
59-
~queryFn=fetchTodos,
60-
~queryKey="todos",
61-
/*
62-
* Helper functions to convert unsupported TypeScript types in ReScript
63-
* Check out the module ReactQuery_Utils.res
64-
*/
65-
~refetchOnWindowFocus=ReactQuery.refetchOnWindowFocus(#bool(false)),
66-
(),
67-
),
68-
)
54+
let queryResult = ReactQuery.useQuery({
55+
queryFn: fetchTodos,
56+
queryKey: ["todos"],
57+
/*
58+
* Helper functions to convert unsupported TypeScript types in ReScript
59+
* Check out the module ReactQuery_Utils.res
60+
*/
61+
refetchOnWindowFocus: ReactQuery.refetchOnWindowFocus(#bool(false)),
62+
})
6963
7064
<div>
7165
{switch queryResult {
@@ -86,7 +80,10 @@ let client = ReactQuery.Provider.createClient()
8680
@react.component
8781
let make = () => {
8882
<ReactQuery.Provider client>
89-
<div> <h1> {React.string("ReScript + React Query")} </h1> <TodoItem /> </div>
83+
<div>
84+
<h1> {React.string("ReScript + React Query")} </h1>
85+
<TodoItem />
86+
</div>
9087
</ReactQuery.Provider>
9188
}
9289
```

0 commit comments

Comments
 (0)