Skip to content

Commit

Permalink
fix: leadding when debounce change event
Browse files Browse the repository at this point in the history
  • Loading branch information
NewByVector committed Jul 24, 2024
1 parent 8ebac56 commit 921499b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/xflow",
"version": "2.1.11",
"version": "2.1.12",
"description": "",
"main": "dist/index.cjs.js",
"module": "dist/index.esm.js",
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/components/State.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -219,13 +219,15 @@ const XFlowState: FC<
({ cell, key, current, options }: EventArgs['cell:change:*']) => {
if (!options[INNER_CALL] && graph) {
if (cell.isNode()) {
console.log('cell:change:*', cell.id, key, current);
updateNode(cell.id, preprocess(key, current, graph), { silent: true });
} else if (cell.isEdge()) {
updateEdge(cell.id, { [key]: current }, { silent: true });
}
}
},
100,
{ leading: true },
),
);

Expand Down

0 comments on commit 921499b

Please sign in to comment.