mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-03-17 10:03:08 +00:00
* Changes from fix/board-react-crash * fix: Prevent cascading re-renders and crashes from high-frequency WS events
20 lines
608 B
TypeScript
20 lines
608 B
TypeScript
/**
|
|
* Lightweight module-level state tracking which features are mid-transition
|
|
* (e.g., being cancelled). Used by useAutoModeQueryInvalidation to skip
|
|
* redundant cache invalidations while persistFeatureUpdate is in flight.
|
|
*/
|
|
|
|
const transitioningFeatures = new Set<string>();
|
|
|
|
export function markFeatureTransitioning(featureId: string): void {
|
|
transitioningFeatures.add(featureId);
|
|
}
|
|
|
|
export function unmarkFeatureTransitioning(featureId: string): void {
|
|
transitioningFeatures.delete(featureId);
|
|
}
|
|
|
|
export function isAnyFeatureTransitioning(): boolean {
|
|
return transitioningFeatures.size > 0;
|
|
}
|