Skip to content

Commit 0f5b5bb

Browse files
committed
fix: prevent multiple wrap calls;
- Closes #8 - Adds 8 bytes
1 parent 77fa92d commit 0f5b5bb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,9 @@ export default function Navaid(base, on404) {
7676
}
7777

7878
function wrap(type, fn) {
79-
type += 'State';
80-
fn = history[type];
79+
if (history[type]) return;
80+
history[type] = type;
81+
fn = history[type += 'State'];
8182
history[type] = function (uri) {
8283
var ev = new Event(type.toLowerCase());
8384
ev.uri = uri;

0 commit comments

Comments
 (0)