1
0
Fork 0
mirror of synced 2024-09-10 22:46:09 +12:00

Optimise resetting data to smoothly transition when changing datasource

This commit is contained in:
Andrew Kingston 2023-02-28 15:00:10 +00:00
parent 9be7d042a9
commit db469711cf

View file

@ -25,8 +25,6 @@ export const createRowsStore = context => {
}
// Wipe state and fully hydrate next time our fetch returns data
loaded = false
rowCacheMap = {}
rows.set([])
// Create fetch and load initial data
return fetchData({
@ -62,6 +60,8 @@ export const createRowsStore = context => {
if (!loaded) {
// Hydrate initial data
loaded = true
rowCacheMap = {}
rows.set([])
schema.set($$fetch.schema)
primaryDisplay.set($$fetch.definition?.primaryDisplay)
}