Prevent unnecessary store updates
This commit is contained in:
parent
337b1189ec
commit
0f3decd127
|
@ -1,4 +1,4 @@
|
||||||
import { derived, get } from "svelte/store"
|
import { derived } from "svelte/store"
|
||||||
|
|
||||||
export const initialise = context => {
|
export const initialise = context => {
|
||||||
const { scrolledRowCount, rows, visualRowCapacity } = context
|
const { scrolledRowCount, rows, visualRowCapacity } = context
|
||||||
|
|
|
@ -569,10 +569,12 @@ export const initialise = context => {
|
||||||
// Wipe the row change cache when changing row
|
// Wipe the row change cache when changing row
|
||||||
previousFocusedRowId.subscribe(id => {
|
previousFocusedRowId.subscribe(id => {
|
||||||
if (id && !get(inProgressChanges)[id]) {
|
if (id && !get(inProgressChanges)[id]) {
|
||||||
rowChangeCache.update(state => {
|
if (Object.keys(get(rowChangeCache)[id] || {}).length) {
|
||||||
delete state[id]
|
rowChangeCache.update(state => {
|
||||||
return state
|
delete state[id]
|
||||||
})
|
return state
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue