Skip to content

Commit 2849910

Browse files
documentation update
1 parent f22ec8e commit 2849910

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed
11 KB
Binary file not shown.

public/Global Counter.png

78.5 KB
Loading

store/store.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { createStore, applyMiddleware, combineReducers } from "redux";
22
import { createWrapper, HYDRATE } from "next-redux-wrapper";
33
import thunkMiddleware from "redux-thunk";
4-
import counter from "../store/counter/reducer";
4+
import counter from "./counter/reducer";
55

66
//COMBINING ALL REDUCERS
77
const combinedReducer = combineReducers({
@@ -20,17 +20,17 @@ const bindMiddleware = (middleware) => {
2020

2121
const makeStore = ({ isServer }) => {
2222
if (isServer) {
23-
//If it's on server side, create a store simply
23+
//If it's on server side, create a store
2424
return createStore(combinedReducer, bindMiddleware([thunkMiddleware]));
2525
} else {
26-
//If it's on client side, create a store with a persistability feature
26+
//If it's on client side, create a store which will persist
2727
const { persistStore, persistReducer } = require("redux-persist");
2828
const storage = require("redux-persist/lib/storage").default;
2929

3030
const persistConfig = {
3131
key: "nextjs",
3232
whitelist: ["counter"], // make sure it does not clash with server keys
33-
storage,
33+
storage, // use a safer storage
3434
};
3535

3636
const persistedReducer = persistReducer(persistConfig, combinedReducer);

0 commit comments

Comments
 (0)