Skip to content

Commit 910b525

Browse files
authored
Merge pull request #23 from kartiklad/master
removed redux-localstorage
2 parents a36ecc3 + 98b6432 commit 910b525

File tree

5 files changed

+2
-46
lines changed

5 files changed

+2
-46
lines changed

common/js/store/index.dev.js

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
11
import { compose, createStore, applyMiddleware } from 'redux';
22
import thunk from 'redux-thunk';
33
import rootReducer from 'reducers';
4-
import persistState from 'redux-localstorage';
54
import DevTools from 'containers/DevTools';
65

7-
/* localStorage Persisted States
8-
* Set up persisted state properties via localStorage. They should be added
9-
* by their property name of the piece of state you want to persist, e.g:
10-
* const persistedStates = ['session', 'order'];
11-
*/
12-
const persistedStates = [];
13-
14-
export default function configureStore(initialState, localStorage = true) {
6+
export default function configureStore(initialState) {
157
/* Middleware
168
* Configure this array with the middleware that you want included. thunk
179
* is included by default, and react-router-redux's syncHistory is also
@@ -24,13 +16,6 @@ export default function configureStore(initialState, localStorage = true) {
2416
DevTools.instrument()
2517
];
2618

27-
// Client-side enhancers and middleware
28-
if (isBrowser()) {
29-
if (localStorage) {
30-
enhancers.push(persistState(persistedStates));
31-
}
32-
}
33-
3419
const enhancer = compose(...[
3520
applyMiddleware(...middleware),
3621
...enhancers
@@ -49,7 +34,3 @@ export default function configureStore(initialState, localStorage = true) {
4934

5035
return store;
5136
}
52-
53-
function isBrowser() {
54-
return (typeof window !== 'undefined' && typeof window.document !== 'undefined');
55-
}

common/js/store/index.prod.js

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
11
import { compose, createStore, applyMiddleware } from 'redux';
22
import thunk from 'redux-thunk';
33
import rootReducer from 'reducers';
4-
import persistState from 'redux-localstorage';
54

6-
/* localStorage Persisted States
7-
* Set up persisted state properties via localStorage. They should be added
8-
* by their property name of the piece of state you want to persist, e.g:
9-
* const persistedStates = ['session', 'order'];
10-
*/
11-
const persistedStates = [];
12-
13-
export default function configureStore(initialState, localStorage = true) {
5+
export default function configureStore(initialState) {
146
/* Middleware
157
* Configure this array with the middleware that you want included. thunk
168
* is included by default, and react-router-redux's syncHistory is also
@@ -21,13 +13,6 @@ export default function configureStore(initialState, localStorage = true) {
2113
// Add universal enhancers here
2214
let enhancers = [];
2315

24-
// Client-side enhancers and middleware
25-
if (isBrowser()) {
26-
if (localStorage) {
27-
enhancers.push(persistState(persistedStates));
28-
}
29-
}
30-
3116
const enhancer = compose(...[
3217
applyMiddleware(...middleware),
3318
...enhancers
@@ -38,7 +23,3 @@ export default function configureStore(initialState, localStorage = true) {
3823

3924
return store;
4025
}
41-
42-
function isBrowser() {
43-
return (typeof window !== 'undefined' && typeof window.document !== 'undefined');
44-
}

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@
8888
"react-router": "3.0.0",
8989
"react-router-redux": "4.0.6",
9090
"redux": "3.6.0",
91-
"redux-localstorage": "0.4.1",
9291
"redux-thunk": "2.1.0",
9392
"reselect": "2.5.4",
9493
"resolve-url-loader": "1.6.0",

webpack/base.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ export default {
2323
'react-router',
2424
'react-router-redux',
2525
'redux',
26-
'redux-localstorage',
2726
'redux-thunk',
2827
'reselect'
2928
],

yarn.lock

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4200,10 +4200,6 @@ redux-devtools@3.3.1:
42004200
redux "^3.5.2"
42014201
redux-devtools-instrument "^1.0.1"
42024202

4203-
redux-localstorage@0.4.1:
4204-
version "0.4.1"
4205-
resolved "https://registry.yarnpkg.com/redux-localstorage/-/redux-localstorage-0.4.1.tgz#faf6d719c581397294d811473ffcedee065c933c"
4206-
42074203
redux-thunk@2.1.0:
42084204
version "2.1.0"
42094205
resolved "https://registry.yarnpkg.com/redux-thunk/-/redux-thunk-2.1.0.tgz#c724bfee75dbe352da2e3ba9bc14302badd89a98"

0 commit comments

Comments
 (0)