Explicitly fetch the data from fetch
This commit is contained in:
parent
e4689e9cf5
commit
a5ec510280
|
@ -179,9 +179,6 @@ export default abstract class DataFetch<
|
||||||
this.store.update($store => ({ ...$store, loaded: true }))
|
this.store.update($store => ({ ...$store, loaded: true }))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initially fetch data but don't bother waiting for the result
|
|
||||||
this.getInitialData()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -33,7 +33,12 @@ const DataFetchMap = {
|
||||||
export const fetchData = ({ API, datasource, options }: any) => {
|
export const fetchData = ({ API, datasource, options }: any) => {
|
||||||
const Fetch =
|
const Fetch =
|
||||||
DataFetchMap[datasource?.type as keyof typeof DataFetchMap] || TableFetch
|
DataFetchMap[datasource?.type as keyof typeof DataFetchMap] || TableFetch
|
||||||
return new Fetch({ API, datasource, ...options })
|
const fetch = new Fetch({ API, datasource, ...options })
|
||||||
|
|
||||||
|
// Initially fetch data but don't bother waiting for the result
|
||||||
|
fetch.getInitialData()
|
||||||
|
|
||||||
|
return fetch
|
||||||
}
|
}
|
||||||
|
|
||||||
// Creates an empty fetch instance with no datasource configured, so no data
|
// Creates an empty fetch instance with no datasource configured, so no data
|
||||||
|
|
Loading…
Reference in New Issue