Update types
This commit is contained in:
parent
5f508ad7ca
commit
19bfd71096
|
@ -101,12 +101,12 @@ export const fetchData = <
|
||||||
|
|
||||||
// Creates an empty fetch instance with no datasource configured, so no data
|
// Creates an empty fetch instance with no datasource configured, so no data
|
||||||
// will initially be loaded
|
// will initially be loaded
|
||||||
const createEmptyFetchInstance = ({
|
const createEmptyFetchInstance = <T extends DataFetchDatasource>({
|
||||||
API,
|
API,
|
||||||
datasource,
|
datasource,
|
||||||
}: {
|
}: {
|
||||||
API: APIClient
|
API: APIClient
|
||||||
datasource: DataFetchDatasource
|
datasource: T
|
||||||
}) => {
|
}) => {
|
||||||
const handler = DataFetchMap[datasource?.type]
|
const handler = DataFetchMap[datasource?.type]
|
||||||
if (!handler) {
|
if (!handler) {
|
||||||
|
@ -114,7 +114,7 @@ const createEmptyFetchInstance = ({
|
||||||
}
|
}
|
||||||
return new handler({
|
return new handler({
|
||||||
API,
|
API,
|
||||||
datasource: null as never,
|
datasource: datasource as any,
|
||||||
query: null as any,
|
query: null as any,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue