UNPKG

519 BPlain TextView Raw
1import { AxesOption } from "./Axes";
2export class InterruptManager {
3 private _prevented = false; // check whether the animation event was prevented
4 constructor(private options: AxesOption) { }
5
6 isInterrupting() {
7 // when interruptable is 'true', return value is always 'true'.
8 return this.options.interruptable || this._prevented;
9 }
10
11 isInterrupted() {
12 return !this.options.interruptable && this._prevented;
13 }
14
15 setInterrupt(prevented) {
16 !this.options.interruptable && (this._prevented = prevented);
17 }
18}