mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
getting token / error
This commit is contained in:
parent
956802d5a5
commit
dc6f72baf1
26 changed files with 269 additions and 374 deletions
|
@ -8,8 +8,10 @@ import { createBrowserHistory } from "history";
|
|||
import { PersistConfig, Persistor } from "redux-persist/es/types";
|
||||
import { routerMiddleware } from "connected-react-router";
|
||||
|
||||
import userReducer, { IUserState } from "~/redux/user/reducer";
|
||||
import userSaga from "~/redux/user/sagas";
|
||||
import userReducer from "~/redux/auth/reducer";
|
||||
import userSaga from "~/redux/auth/sagas";
|
||||
|
||||
import { IAuthState } from "~/redux/auth/types";
|
||||
|
||||
import modalReducer, { IModalState } from "~/redux/modal/reducer";
|
||||
import { IState } from "~/redux/store";
|
||||
|
@ -21,7 +23,7 @@ const userPersistConfig: PersistConfig = {
|
|||
};
|
||||
|
||||
export interface IState {
|
||||
user: IUserState;
|
||||
auth: IAuthState;
|
||||
modal: IModalState;
|
||||
router: RouterState;
|
||||
}
|
||||
|
@ -35,15 +37,15 @@ const composeEnhancers =
|
|||
: compose;
|
||||
|
||||
export const store = createStore(
|
||||
combineReducers({
|
||||
user: persistReducer(userPersistConfig, userReducer),
|
||||
combineReducers<IState>({
|
||||
auth: persistReducer(userPersistConfig, userReducer),
|
||||
modal: modalReducer,
|
||||
router: connectRouter(history)
|
||||
}),
|
||||
composeEnhancers(applyMiddleware(routerMiddleware(history), sagaMiddleware))
|
||||
);
|
||||
|
||||
export function configureStore(): { store: Store<any>; persistor: Persistor } {
|
||||
export function configureStore(): { store: Store<IState>; persistor: Persistor } {
|
||||
sagaMiddleware.run(userSaga);
|
||||
|
||||
const persistor = persistStore(store);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue