-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy pathindex.rsc.ts
46 lines (40 loc) · 1.24 KB
/
index.rsc.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// This must remain here so that the `mangleErrors.cjs` build script
// does not have to import this into each source file it rewrites.
import { formatProdErrorMessage } from '@reduxjs/toolkit'
import { buildCreateApi, coreModule } from '@reduxjs/toolkit/query'
import { unboundHooksModule, reactHooksModuleName } from './module'
export * from '@reduxjs/toolkit/query'
export { ApiProvider } from './ApiProvider'
const throwFn = () => {
throw new Error('Hooks can only be used in Client Components')
}
const reactHooksModule = unboundHooksModule({
hooks: {
useDispatch: throwFn,
useSelector: throwFn,
useStore: throwFn,
},
batch: throwFn,
})
const createApi = /* @__PURE__ */ buildCreateApi(
coreModule(),
reactHooksModule()
)
export type {
TypedUseMutationResult,
TypedUseQueryHookResult,
TypedUseQueryStateResult,
TypedUseQuerySubscriptionResult,
TypedLazyQueryTrigger,
TypedUseLazyQuery,
TypedUseMutation,
TypedMutationTrigger,
TypedQueryStateSelector,
TypedUseQueryState,
TypedUseQuery,
TypedUseQuerySubscription,
TypedUseLazyQuerySubscription,
TypedUseQueryStateOptions,
} from './buildHooks'
export { UNINITIALIZED_VALUE } from './constants'
export { createApi, reactHooksModule, reactHooksModuleName }