@bian-womp/spark-workbench 0.2.82 → 0.2.83
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/cjs/index.cjs
CHANGED
|
@@ -2292,8 +2292,9 @@ function useWorkbenchBridge(wb) {
|
|
|
2292
2292
|
function useWorkbenchGraphTick(wb) {
|
|
2293
2293
|
const [tick, setTick] = React.useState(0);
|
|
2294
2294
|
React.useEffect(() => {
|
|
2295
|
-
const
|
|
2296
|
-
|
|
2295
|
+
const off = wb.on("graphChanged", () => {
|
|
2296
|
+
setTick((t) => t + 1);
|
|
2297
|
+
});
|
|
2297
2298
|
return () => off();
|
|
2298
2299
|
}, [wb]);
|
|
2299
2300
|
return tick;
|
|
@@ -2301,8 +2302,11 @@ function useWorkbenchGraphTick(wb) {
|
|
|
2301
2302
|
function useWorkbenchGraphUiTick(wb) {
|
|
2302
2303
|
const [tick, setTick] = React.useState(0);
|
|
2303
2304
|
React.useEffect(() => {
|
|
2304
|
-
const
|
|
2305
|
-
|
|
2305
|
+
const off = wb.on("graphUiChanged", (evt) => {
|
|
2306
|
+
if (evt.change?.type === "viewport")
|
|
2307
|
+
return;
|
|
2308
|
+
setTick((t) => t + 1);
|
|
2309
|
+
});
|
|
2306
2310
|
return () => off();
|
|
2307
2311
|
}, [wb]);
|
|
2308
2312
|
return tick;
|