Precent unecessary client app builder store updates to improve performance

This commit is contained in:
Andrew Kingston 2021-11-16 13:35:20 +00:00
parent 5021f3df47
commit b1f5782984
1 changed files with 6 additions and 0 deletions

View File

@ -80,9 +80,15 @@ const createBuilderStore = () => {
}) })
}, },
setDragging: dragging => { setDragging: dragging => {
if (dragging === get(writableStore).isDragging) {
return
}
writableStore.update(state => ({ ...state, isDragging: dragging })) writableStore.update(state => ({ ...state, isDragging: dragging }))
}, },
setEditMode: enabled => { setEditMode: enabled => {
if (enabled === get(writableStore).editMode) {
return
}
writableStore.update(state => ({ ...state, editMode: enabled })) writableStore.update(state => ({ ...state, editMode: enabled }))
}, },
} }