mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 11:06:40 +07:00
redux: initial
This commit is contained in:
parent
0fcd0bd209
commit
dca55a3bc4
6 changed files with 55 additions and 54 deletions
|
@ -1,4 +1,4 @@
|
|||
export const AUTH_ACTIONS = {
|
||||
export const ACTIONS = {
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { createReducer } from 'reduxsauce';
|
||||
import { AUTH_ACTIONS, EMPTY_USER } from '$redux/auth/constants';
|
||||
import { ACTIONS, EMPTY_USER } from '$redux/auth/constants';
|
||||
|
||||
const HANDLERS = {
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ import { persistStore, persistReducer } from 'redux-persist';
|
|||
import storage from 'redux-persist/lib/storage';
|
||||
import createSagaMiddleware from 'redux-saga';
|
||||
import createHistory from 'history/createBrowserHistory';
|
||||
import { routerReducer, routerMiddleware } from 'react-router-redux';
|
||||
// import { routerReducer, routerMiddleware } from 'react-router-redux';
|
||||
|
||||
import { authReducer } from '$redux/auth/reducer';
|
||||
import { authSaga } from '$redux/auth/sagas';
|
||||
|
@ -27,17 +27,20 @@ const composeEnhancers =
|
|||
: compose;
|
||||
/* eslint-enable no-underscore-dangle */
|
||||
|
||||
export const history = createHistory();
|
||||
// export const history = createHistory();
|
||||
|
||||
export const store = createStore(
|
||||
combineReducers({
|
||||
auth: persistReducer(authPersistConfig, authReducer),
|
||||
routing: routerReducer
|
||||
// routing: routerReducer
|
||||
}),
|
||||
composeEnhancers(applyMiddleware(routerMiddleware(history), sagaMiddleware))
|
||||
composeEnhancers(applyMiddleware(
|
||||
// routerMiddleware(history),
|
||||
sagaMiddleware
|
||||
))
|
||||
);
|
||||
|
||||
export default function configureStore() {
|
||||
export function configureStore() {
|
||||
// run sagas
|
||||
sagaMiddleware.run(authSaga);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue