Skip to content

Commit

Permalink
golf: remove off variable;
Browse files Browse the repository at this point in the history
- drops 5 bytes (gzip)
  • Loading branch information
lukeed committed Jun 3, 2019
1 parent 11a5f29 commit 77fa92d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,16 @@ export default function Navaid(base, on404) {
}
}

var off = removeEventListener;
addEventListener('popstate', run);
addEventListener('replacestate', run);
addEventListener('pushstate', run);
addEventListener('click', click);

$.unlisten = function () {
off('popstate', run);
off('replacestate', run);
off('pushstate', run);
off('click', click);
removeEventListener('popstate', run);
removeEventListener('replacestate', run);
removeEventListener('pushstate', run);
removeEventListener('click', click);
}

return $.run();
Expand Down

0 comments on commit 77fa92d

Please sign in to comment.