diff --git a/docs/framework/react/community/batching-requests-using-bathshit.md b/docs/framework/react/community/batching-requests-using-bathshit.md index e1b88fc269..784da772f9 100644 --- a/docs/framework/react/community/batching-requests-using-bathshit.md +++ b/docs/framework/react/community/batching-requests-using-bathshit.md @@ -21,11 +21,11 @@ The problem is that orchestrating a single fetch for all rendered user details c First lets setup a batcher using [@yornaath/batshit](https://www.npmjs.com/package/@yornaath/batshit) ```ts -import { Batcher, windowScheduler, keyResolver } from "@yornaath/batshit" +import { create, windowScheduler, keyResolver } from "@yornaath/batshit" type User = { id: number, name: string } -const users = Batcher({ +const users = create({ // The fetcher resolves the list of queries(here just a list of user ids as number) to one single api call. fetcher: async (ids: number[]) => { return api.users.where({ @@ -72,4 +72,4 @@ const UserDetails = (props: {userId: number}) => { ### batshit docs For more information about how to create batchers with custom resolving and request scheduling please refer to the batshit repo readme -over at the [yornaath/batshit github repository](https://github.com/yornaath/batshit/) \ No newline at end of file +over at the [yornaath/batshit github repository](https://github.com/yornaath/batshit/)