"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.store = exports.resetEverything = void 0;
/* eslint-disable */
const redux_1 = require("redux");
const toolkit_1 = require("@reduxjs/toolkit");
const roomSlice_1 = __importDefault(require("./roomSlice"));
const peersSlice_1 = __importDefault(require("./peersSlice"));
const participantSlice_1 = __importDefault(require("./participantSlice"));
const pluginSlice_1 = __importDefault(require("./pluginSlice"));
const consumersSlice_1 = __importDefault(require("./consumersSlice"));
const producerSlice_1 = __importDefault(require("./producerSlice"));
const middlewares = [
/* other middlewares */
];
// if (DYTE_DEV_MODE) {
//     const createDebugger = require("redux-flipper").default;
//     middlewares.push(createDebugger());
// }
const resetEverything = () => ({
    type: 'end_meeting',
});
exports.resetEverything = resetEverything;
const appReducers = redux_1.combineReducers({
    room: roomSlice_1.default,
    peers: peersSlice_1.default,
    participant: participantSlice_1.default,
    plugin: pluginSlice_1.default,
    consumers: consumersSlice_1.default,
    producers: producerSlice_1.default,
});
const rootReducer = (state, action) => {
    if (action.type === 'end_meeting') {
        // check for action type
        state = undefined;
    }
    return appReducers(state, action);
};
exports.store = toolkit_1.configureStore({
    reducer: rootReducer,
    middleware: (getDefaultMiddleware) => {
        return getDefaultMiddleware().concat(middlewares);
    },
    devTools: true,
});
//# sourceMappingURL=store.js.map