Skip to content

Commit

Permalink
Added isClosing property to Popup
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexShukel committed Jun 16, 2022
1 parent 744c21b commit dc81ba9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/types/Popup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { PopupIdentifier } from './PopupIdentifier';
import { CLOSE_NOT_IMPLEMENTED } from '../constants';

export abstract class Popup<P> {
public isClosing = false;

constructor(
public PopupComponent: ComponentType<P>,
public props: P,
Expand All @@ -17,6 +19,9 @@ export abstract class Popup<P> {
public setCloseHandler: (close: () => void | Promise<void>) => void = (
close
) => {
this.close = close;
this.close = () => {
this.isClosing = true;
return close();
};
};
}

0 comments on commit dc81ba9

Please sign in to comment.