|
Last change
on this file since a762898 was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago |
|
Added visualizations
|
-
Property mode
set to
100644
|
|
File size:
601 bytes
|
| Line | |
|---|
| 1 | import type { BaseQueryFn } from './baseQueryTypes'
|
|---|
| 2 |
|
|---|
| 3 | export const _NEVER = /* @__PURE__ */ Symbol()
|
|---|
| 4 | export type NEVER = typeof _NEVER
|
|---|
| 5 |
|
|---|
| 6 | /**
|
|---|
| 7 | * Creates a "fake" baseQuery to be used if your api *only* uses the `queryFn` definition syntax.
|
|---|
| 8 | * This also allows you to specify a specific error type to be shared by all your `queryFn` definitions.
|
|---|
| 9 | */
|
|---|
| 10 | export function fakeBaseQuery<ErrorType>(): BaseQueryFn<
|
|---|
| 11 | void,
|
|---|
| 12 | NEVER,
|
|---|
| 13 | ErrorType,
|
|---|
| 14 | {}
|
|---|
| 15 | > {
|
|---|
| 16 | return function () {
|
|---|
| 17 | throw new Error(
|
|---|
| 18 | 'When using `fakeBaseQuery`, all queries & mutations must use the `queryFn` definition syntax.',
|
|---|
| 19 | )
|
|---|
| 20 | }
|
|---|
| 21 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.