feat: added redux
This commit is contained in:
21
furumi-node-player/client/src/store/index.ts
Normal file
21
furumi-node-player/client/src/store/index.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { configureStore } from '@reduxjs/toolkit'
|
||||
import { useDispatch, useSelector, type TypedUseSelectorHook } from 'react-redux'
|
||||
import artistsReducer from './slices/artistsSlice'
|
||||
import albumsReducer from './slices/albumsSlice'
|
||||
import albumTracksReducer from './slices/albumTracksSlice'
|
||||
import trackDetailReducer from './slices/trackDetailSlice'
|
||||
|
||||
export const store = configureStore({
|
||||
reducer: {
|
||||
artists: artistsReducer,
|
||||
albums: albumsReducer,
|
||||
albumTracks: albumTracksReducer,
|
||||
trackDetail: trackDetailReducer,
|
||||
},
|
||||
})
|
||||
|
||||
export type RootState = ReturnType<typeof store.getState>
|
||||
export type AppDispatch = typeof store.dispatch
|
||||
|
||||
export const useAppDispatch = useDispatch.withTypes<AppDispatch>()
|
||||
export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector
|
||||
Reference in New Issue
Block a user