-
Notifications
You must be signed in to change notification settings - Fork 0
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
11 changed files
with
88 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
echo test |
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,9 +1,17 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom/client'; | ||
import App from './App.tsx'; | ||
import { Provider } from 'react-redux'; | ||
import { PersistGate } from 'redux-persist/integration/react'; | ||
|
||
import App from './App'; | ||
import { persistor, store } from './store'; | ||
|
||
ReactDOM.createRoot(document.getElementById('root')!).render( | ||
<React.StrictMode> | ||
<App /> | ||
<Provider store={store}> | ||
<PersistGate loading={null} persistor={persistor}> | ||
<App /> | ||
</PersistGate> | ||
</Provider> | ||
</React.StrictMode>, | ||
); |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
function getMessages( | ||
message: string, | ||
amount: number, | ||
seconds: number = 1, | ||
): Promise<string[]> { | ||
return new Promise((resolve) => { | ||
setTimeout( | ||
() => resolve(new Array<string>(amount).fill(message)), | ||
seconds * 1000, | ||
); | ||
}); | ||
} | ||
|
||
export default getMessages; |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default as getMessages } from './getMessages'; |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { | ||
TypedUseSelectorHook, | ||
useDispatch as useAppDispatch, | ||
useSelector as useAppSelector, | ||
} from 'react-redux'; | ||
|
||
import type { AppDispatch, RootState } from './store'; | ||
|
||
export const useDispatch = (): AppDispatch => useAppDispatch<AppDispatch>(); | ||
export const useSelector: TypedUseSelectorHook<RootState> = useAppSelector; |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export { useDispatch, useSelector } from './hooks'; | ||
export { store, persistor, type RootState, type AppStore } from './store'; |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { combineReducers } from '@reduxjs/toolkit'; | ||
|
||
export const rootReducer = combineReducers({ | ||
// [AUTH_SLICE_NAME]: authReducer, | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { configureStore } from '@reduxjs/toolkit'; | ||
import { persistReducer, persistStore } from 'redux-persist'; | ||
import storage from 'redux-persist/lib/storage'; | ||
|
||
import { rootReducer } from './rootReducer'; | ||
|
||
const persistConfig = { | ||
key: 'root', | ||
storage, | ||
whitelist: [], | ||
}; | ||
|
||
const persistedReducer = persistReducer(persistConfig, rootReducer); | ||
export const store = configureStore({ | ||
reducer: persistedReducer, | ||
middleware: (getDefaultMiddleware) => { | ||
return getDefaultMiddleware({ | ||
serializableCheck: false, | ||
}); | ||
}, | ||
}); | ||
|
||
export const persistor = persistStore(store); | ||
|
||
export type AppStore = typeof store; | ||
export type AppDispatch = AppStore['dispatch']; | ||
export type RootState = ReturnType<AppStore['getState']>; |
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