Optimise resetting data to smoothly transition when changing datasource
This commit is contained in:
parent
9be7d042a9
commit
db469711cf
1 changed files with 2 additions and 2 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue