Skip to content

Commit 77264b1

Browse files
author
Zt2tzzt
committed
offStates fix
1 parent f3388c5 commit 77264b1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/event-store.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,9 @@ class HYEventStore {
7272
}
7373

7474
offStates(stateKeys, stateCallback) {
75+
const keys = Object.keys(this.state)
7576
stateKeys.forEach(theKey => {
76-
if (keys.indexOf(stateKey) === -1) {
77+
if (keys.indexOf(theKey) === -1) {
7778
throw new Error("the state does not contain your key")
7879
}
7980
this.eventV2.off(theKey, stateCallback)

0 commit comments

Comments
 (0)