Toggle navigation
Toggle navigation
This project
Loading...
Sign in
khusat
/
khusat-front
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
이준호
2020-12-10 20:52:42 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
5a15dfe8ab9cc08135df440af031cc69717d4e56
5a15dfe8
1 parent
a4602778
[ADD] redux-persist 모듈 추가로 새로고침 대응
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
1 deletions
package.json
src/index.js
src/store/index.js
yarn.lock
package.json
View file @
5a15dfe
...
...
@@ -20,6 +20,7 @@
"react-social-kr"
:
"^1.1.9"
,
"redux"
:
"^4.0.5"
,
"redux-devtools-extension"
:
"^2.13.8"
,
"redux-persist"
:
"^6.0.0"
,
"redux-thunk"
:
"^2.3.0"
,
"sass-loader"
:
"^10.1.0"
,
"styled-components"
:
"^5.2.1"
,
...
...
src/index.js
View file @
5a15dfe
...
...
@@ -11,14 +11,19 @@ import {createStore,applyMiddleware} from "redux";
import
rootReducer
from
"./store/index"
;
import
Thunk
from
'redux-thunk'
;
import
{
composeWithDevTools
}
from
"redux-devtools-extension"
;
import
{
persistStore
}
from
"redux-persist"
;
import
{
PersistGate
}
from
"redux-persist/integration/react"
;
const
store
=
createStore
(
rootReducer
,
composeWithDevTools
(
applyMiddleware
(
Thunk
)));
const
persistor
=
persistStore
(
store
);
ReactDOM
.
render
(
<
Provider
store
=
{
store
}
>
<
PersistGate
persistor
=
{
persistor
}
>
<
React
.
StrictMode
>
<
App
/>
<
/React.StrictMode
>
<
/PersistGate
>
<
/Provider>
,
document
.
getElementById
(
'root'
)
);
...
...
src/store/index.js
View file @
5a15dfe
import
{
combineReducers
}
from
'redux'
;
import
{
persistReducer
}
from
"redux-persist"
;
import
result
from
"./action/result"
;
import
survey
from
"./action/survey"
;
import
storage
from
"redux-persist/lib/storage"
;
const
persistConfig
=
{
key
:
"root"
,
storage
:
storage
,
whitelist
:
[
"result"
,
"survey"
],
};
const
rootReducer
=
combineReducers
({
result
,
survey
})
export
default
rootReducer
;
\ No newline at end of file
export
default
persistReducer
(
persistConfig
,
rootReducer
);
\ No newline at end of file
...
...
yarn.lock
View file @
5a15dfe
...
...
@@ -10250,6 +10250,11 @@ redux-devtools-extension@^2.13.8:
resolved "https://registry.yarnpkg.com/redux-devtools-extension/-/redux-devtools-extension-2.13.8.tgz#37b982688626e5e4993ff87220c9bbb7cd2d96e1"
integrity sha512-8qlpooP2QqPtZHQZRhx3x3OP5skEV1py/zUdMY28WNAocbafxdG2tRD1MWE7sp8obGMNYuLWanhhQ7EQvT1FBg==
redux-persist@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/redux-persist/-/redux-persist-6.0.0.tgz#b4d2972f9859597c130d40d4b146fecdab51b3a8"
integrity sha512-71LLMbUq2r02ng2We9S215LtPu3fY0KgaGE0k8WRgl6RkqxtGfl7HUozz1Dftwsb0D/5mZ8dwAaPbtnzfvbEwQ==
redux-thunk@^2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/redux-thunk/-/redux-thunk-2.3.0.tgz#51c2c19a185ed5187aaa9a2d08b666d0d6467622"
...
...
Please
register
or
login
to post a comment