refactor(updates): only trigger dim updates when dim changed

This commit is contained in:
moklick
2024-04-11 12:31:14 +02:00
parent 63aa0dd713
commit 4fa3a87241
14 changed files with 57 additions and 53 deletions
@@ -10,7 +10,7 @@ import { useStore } from '$lib/store';
* @returns function for updating node internals
*/
export function useUpdateNodeInternals(): UpdateNodeInternals {
const { domNode, updateNodeDimensions } = useStore();
const { domNode, updateNodeInternals } = useStore();
// @todo: do we want to add this to system?
const updateInternals = (id: string | string[]) => {
@@ -27,7 +27,7 @@ export function useUpdateNodeInternals(): UpdateNodeInternals {
}
});
requestAnimationFrame(() => updateNodeDimensions(updates));
requestAnimationFrame(() => updateNodeInternals(updates));
};
return updateInternals;