diff options
| author | Max Nanis | 2025-05-28 04:41:37 +0100 |
|---|---|---|
| committer | Max Nanis | 2025-05-28 04:41:37 +0100 |
| commit | 8caa77413ea372e5cbd2980a9922d701af359c04 (patch) | |
| tree | 9341e2f70fab6b2678fdff53c002954ef69c7b3e /src/store.ts | |
| download | panel-ui-8caa77413ea372e5cbd2980a9922d701af359c04.tar.gz panel-ui-8caa77413ea372e5cbd2980a9922d701af359c04.zip | |
initial commit
Diffstat (limited to 'src/store.ts')
| -rw-r--r-- | src/store.ts | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/store.ts b/src/store.ts new file mode 100644 index 0000000..4bd54ca --- /dev/null +++ b/src/store.ts @@ -0,0 +1,28 @@ +import type {Action, ThunkAction} from '@reduxjs/toolkit' +import {configureStore} from '@reduxjs/toolkit' +import bucketReducers from "@/models/bucketSlice.ts" +import questionReducers from "@/models/questionSlice.ts" +import appReducers from "@/models/appSlice.ts" + +export const store = configureStore({ + reducer: { + app: appReducers, + buckets: bucketReducers, + questions: questionReducers + } +}) + +// Infer the type of `store` +export type AppStore = typeof store +// Infer the `AppDispatch` type from the store itself +export type AppDispatch = typeof store.dispatch +// Same for the `RootState` type +export type RootState = ReturnType<typeof store.getState> + +// Define a reusable type describing thunk functions +export type AppThunk<ThunkReturnType = void> = ThunkAction< + ThunkReturnType, + RootState, + unknown, + Action +>
\ No newline at end of file |
