-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
1,387 additions
and
916 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
import { Dispatch } from 'react' | ||
import { TypedUseSelectorHook, useDispatch, useSelector } from 'react-redux' | ||
import { AnyAction } from 'redux' | ||
import type { RootState, AppDispatch } from './' | ||
import { Dispatch } from "react"; | ||
import { TypedUseSelectorHook, useDispatch, useSelector } from "react-redux"; | ||
import { AnyAction } from "redux"; | ||
import type { RootState, AppDispatch } from "./"; | ||
|
||
export const useAppDispatch = (): Dispatch<AnyAction> => useDispatch<AppDispatch>() | ||
export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector | ||
export const useAppDispatch = (): Dispatch<AnyAction> => | ||
useDispatch<AppDispatch>(); | ||
export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
import { createStore, applyMiddleware, compose, Store } from "redux" | ||
import thunk from "redux-thunk" | ||
import { persistStore, persistReducer } from "redux-persist" | ||
import storage from "redux-persist/lib/storage" // defaults to localStorage for web | ||
import { createStore, applyMiddleware, compose, Store } from "redux"; | ||
import thunk from "redux-thunk"; | ||
import { persistStore, persistReducer } from "redux-persist"; | ||
import storage from "redux-persist/lib/storage"; // defaults to localStorage for web | ||
|
||
import rootReducer from "./reducers" | ||
import { Persistor } from "redux-persist/lib/types" | ||
import rootReducer from "./reducers"; | ||
import { Persistor } from "redux-persist/lib/types"; | ||
|
||
const middleware = [thunk] | ||
const middleware = [thunk]; | ||
|
||
const rootPersistConfig = { | ||
key: "root", | ||
storage: storage, | ||
whitelist: ["addresses", "config"], | ||
} | ||
}; | ||
|
||
const store = createStore( | ||
persistReducer(rootPersistConfig, rootReducer), | ||
compose(applyMiddleware(...middleware)) | ||
) | ||
); | ||
|
||
export type RootState = ReturnType<typeof store.getState> | ||
export type AppDispatch = typeof store.dispatch | ||
export type RootState = ReturnType<typeof store.getState>; | ||
export type AppDispatch = typeof store.dispatch; | ||
|
||
export default (): { store: Store; persistor: Persistor } => { | ||
const persistor = persistStore(store) | ||
return { store, persistor } | ||
} | ||
const persistor = persistStore(store); | ||
return { store, persistor }; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2164,4 +2164,4 @@ | |
.mx-xl-auto { | ||
margin-left: auto !important; | ||
} | ||
} | ||
} |
Oops, something went wrong.