This commit is contained in:
2025-12-18 14:26:17 +01:00
parent 61f675d991
commit bf1f09c774
9 changed files with 387 additions and 30 deletions

View File

@@ -0,0 +1,22 @@
import { Blocker } from './Blocker';
/**
* SubmitBlocker prevents multiple submissions until explicitly released.
*
* Useful for preventing duplicate form submissions or API calls.
*/
export class SubmitBlocker extends Blocker {
private blocked = false;
canExecute(): boolean {
return !this.blocked;
}
block(): void {
this.blocked = true;
}
release(): void {
this.blocked = false;
}
}