blob: d0dbd8950045cfa82b38d22d73c2851aab6367ef [file] [log] [blame]
simon26e79f72022-10-05 22:16:08 -04001/*
2 * Copyright (C) 2022 Savoir-faire Linux Inc.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Affero General Public License as
6 * published by the Free Software Foundation; either version 3 of the
7 * License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Affero General Public License for more details.
13 *
14 * You should have received a copy of the GNU Affero General Public
15 * License along with this program. If not, see
16 * <https://www.gnu.org/licenses/>.
17 */
simond47ef9e2022-09-28 22:24:28 -040018import { configureStore } from '@reduxjs/toolkit';
simon07b4eb02022-09-29 17:50:26 -040019
simond47ef9e2022-09-28 22:24:28 -040020import appReducer from './appSlice';
idillond858c182022-09-16 13:18:26 -040021
22export const store = configureStore({
23 reducer: {
Michelle Sepkap Simee580f422022-10-31 23:27:04 -040024 userInfo: appReducer,
idillond858c182022-09-16 13:18:26 -040025 },
26});
27
28// Infer the `RootState` and `AppDispatch` types from the store itself
29export type RootState = ReturnType<typeof store.getState>;
30// Inferred type: {posts: PostsState, comments: CommentsState, users: UsersState}
31export type AppDispatch = typeof store.dispatch;