Skip to content

Commit 1f9cf0b

Browse files
authored
docs: Fix syntax of batshit in batching-requests article (#9269)
1 parent fff40b7 commit 1f9cf0b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/framework/react/community/batching-requests-using-bathshit.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ The problem is that orchestrating a single fetch for all rendered user details c
2121
First lets setup a batcher using [@yornaath/batshit](https://www.npmjs.com/package/@yornaath/batshit)
2222

2323
```ts
24-
import { Batcher, windowScheduler, keyResolver } from "@yornaath/batshit"
24+
import { create, windowScheduler, keyResolver } from "@yornaath/batshit"
2525

2626
type User = { id: number, name: string }
2727

28-
const users = Batcher<User, number>({
28+
const users = create<User[], number>({
2929
// The fetcher resolves the list of queries(here just a list of user ids as number) to one single api call.
3030
fetcher: async (ids: number[]) => {
3131
return api.users.where({
@@ -72,4 +72,4 @@ const UserDetails = (props: {userId: number}) => {
7272
### batshit docs
7373

7474
For more information about how to create batchers with custom resolving and request scheduling please refer to the batshit repo readme
75-
over at the [yornaath/batshit github repository](https://github.com/yornaath/batshit/)
75+
over at the [yornaath/batshit github repository](https://github.com/yornaath/batshit/)

0 commit comments

Comments
 (0)