Skip to content

Commit 6c9df58

Browse files
1.1.3 Fixed hot reload issue
Fix for #25
1 parent 5f8122c commit 6c9df58

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "next-redux-wrapper",
3-
"version": "1.1.2",
3+
"version": "1.1.3",
44
"description": "Redux wrapper for Next.js",
55
"main": "src/index.js",
66
"scripts": {

src/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ var ReactRedux = require('react-redux');
44
var connect = ReactRedux.connect;
55
var Provider = ReactRedux.Provider;
66

7-
var memoizedStore;
87
var _Promise;
98
var _debug = false;
109
var skipMerge = ['initialState', 'initialProps', 'isServer', 'store'];
10+
var storeKey = '__NEXT_REDUX_STORE__';
1111

1212
function initStore(makeStore, req, initialState) {
1313

@@ -20,11 +20,11 @@ function initStore(makeStore, req, initialState) {
2020
}
2121

2222
// Memoize store if client
23-
if (!memoizedStore) {
24-
memoizedStore = makeStore(initialState);
23+
if (!window[storeKey]) {
24+
window[storeKey] = makeStore(initialState);
2525
}
2626

27-
return memoizedStore;
27+
return window[storeKey];
2828

2929
}
3030

0 commit comments

Comments
 (0)