Optimise resetting data to smoothly transition when changing datasource
This commit is contained in:
parent
9be7d042a9
commit
db469711cf
|
@ -25,8 +25,6 @@ export const createRowsStore = context => {
|
||||||
}
|
}
|
||||||
// Wipe state and fully hydrate next time our fetch returns data
|
// Wipe state and fully hydrate next time our fetch returns data
|
||||||
loaded = false
|
loaded = false
|
||||||
rowCacheMap = {}
|
|
||||||
rows.set([])
|
|
||||||
|
|
||||||
// Create fetch and load initial data
|
// Create fetch and load initial data
|
||||||
return fetchData({
|
return fetchData({
|
||||||
|
@ -62,6 +60,8 @@ export const createRowsStore = context => {
|
||||||
if (!loaded) {
|
if (!loaded) {
|
||||||
// Hydrate initial data
|
// Hydrate initial data
|
||||||
loaded = true
|
loaded = true
|
||||||
|
rowCacheMap = {}
|
||||||
|
rows.set([])
|
||||||
schema.set($$fetch.schema)
|
schema.set($$fetch.schema)
|
||||||
primaryDisplay.set($$fetch.definition?.primaryDisplay)
|
primaryDisplay.set($$fetch.definition?.primaryDisplay)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue