Skip to content

Commit b544c5f

Browse files
committed
The iteration variable wasn't in the correct place
1 parent 05ab684 commit b544c5f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@ function bindApi (hook, state, name) {
1717
})
1818
}
1919

20-
function unnamedHook (state) {
21-
var unnamedHookIterator = 0
22-
var unnamedHookName = 'unnamedHook' + unnamedHookIterator++
20+
function unnamedHook (state, hookIteration) {
21+
var unnamedHookName = 'unnamedHook' + hookIteration
2322
var unnamedHook = register.bind(null, state, unnamedHookName)
2423
bindApi(unnamedHook, state, unnamedHookName)
2524
return unnamedHook
@@ -33,7 +32,8 @@ function Hook () {
3332
var hook = register.bind(null, state)
3433
bindApi(hook, state)
3534

36-
hook.unnamed = unnamedHook.bind(null, state)
35+
var unnamedHookIterator = 0;
36+
hook.unnamed = unnamedHook.bind(null, state, unnamedHookIterator++)
3737

3838
return hook
3939
}

0 commit comments

Comments
 (0)