2024-02-28 16:49:44 +00:00
|
|
|
import _ from 'lodash'
|
2024-02-27 14:03:15 +00:00
|
|
|
import React from 'react'
|
|
|
|
import ReactDOM from 'react-dom/client'
|
2024-02-28 16:49:44 +00:00
|
|
|
import { Provider } from 'react-redux'
|
|
|
|
import { BrowserRouter } from 'react-router-dom'
|
|
|
|
import { ToastContainer } from 'react-toastify'
|
|
|
|
import 'react-toastify/dist/ReactToastify.css'
|
2024-02-27 14:03:15 +00:00
|
|
|
import App from './App.tsx'
|
|
|
|
import './index.css'
|
2024-02-28 16:49:44 +00:00
|
|
|
import store from './store/store.ts'
|
|
|
|
import { saveState } from './utils'
|
|
|
|
|
|
|
|
store.subscribe(
|
|
|
|
_.throttle(() => {
|
|
|
|
saveState({
|
|
|
|
auth: store.getState().auth
|
|
|
|
})
|
|
|
|
}, 1000)
|
|
|
|
)
|
2024-02-27 14:03:15 +00:00
|
|
|
|
|
|
|
ReactDOM.createRoot(document.getElementById('root')!).render(
|
|
|
|
<React.StrictMode>
|
2024-02-28 16:49:44 +00:00
|
|
|
<BrowserRouter>
|
|
|
|
<Provider store={store}>
|
|
|
|
<App />
|
|
|
|
<ToastContainer />
|
|
|
|
</Provider>
|
|
|
|
</BrowserRouter>
|
|
|
|
</React.StrictMode>
|
2024-02-27 14:03:15 +00:00
|
|
|
)
|