[improvement] add closeOnPopstate mixin (#3708)

This commit is contained in:
neverland
2019-07-01 16:29:47 +08:00
committed by GitHub
parent 3eb802a689
commit 2df51f5aef
4 changed files with 52 additions and 26 deletions
+3 -1
View File
@@ -7,7 +7,9 @@ type BindEventMixinThis = {
binded: boolean;
};
export function BindEventMixin(handler: Function) {
type BindEventHandler = (bind: Function, isBind: boolean) => void;
export function BindEventMixin(handler: BindEventHandler) {
function bind(this: BindEventMixinThis) {
if (!this.binded) {
handler.call(this, on, true);