Skip to content

Commit 2befd9d

Browse files
committed
Correct ES6 map usage. Fixes #35
1 parent 0147d42 commit 2befd9d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/createDispatcher.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,17 @@ export default function createDispatcher() {
7474
// Merge the newly added stores
7575
function receiveStores(nextStores) {
7676
Object.keys(nextStores).forEach(key => {
77+
storeKeys.delete(stores[key]);
7778
stores[key] = nextStores[key];
7879
observers[key] = observers[key] || [];
79-
storeKeys[stores[key]] = key;
80+
storeKeys.set(stores[key], key);
8081
});
8182
dispatch(BOOTSTRAP_STORE);
8283
}
8384

8485
// Get the key a store was registered with
8586
function getStoreKey(store) {
86-
const key = storeKeys[store];
87+
const key = storeKeys.get(store);
8788
invariant(key, 'This store is not registered with the Redux root: %s', store);
8889
return key;
8990
}

0 commit comments

Comments
 (0)