rootReducer.ts 1.99 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
/**
 * See the NOTICE file distributed with this work for additional information
 * regarding copyright ownership.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

17 18 19 20 21
import { combineReducers } from 'redux';
import { connectRouter } from 'connected-react-router';

import browser from '../content/app/browser/browserReducer';
import drawer from '../content/app/browser/drawer/drawerReducer';
22
import genome from '../shared/state/genome/genomeReducer';
23
import customDownload from '../content/app/custom-download/state/customDownloadReducer';
24 25
import global from '../global/globalReducer';
import header from '../header/headerReducer';
26
import ensObjects from '../shared/state/ens-object/ensObjectReducer';
Andrey Azov's avatar
Andrey Azov committed
27
import inAppSearch from '../shared/state/in-app-search/inAppSearchSlice';
28
import communication from '../shared/state/communication/communicationSlice';
Andrey Azov's avatar
Andrey Azov committed
29
import speciesSelector from '../content/app/species-selector/state/speciesSelectorReducer';
Andrey Azov's avatar
Andrey Azov committed
30
import entityViewer from 'src/content/app/entity-viewer/state/entityViewerReducer';
Andrey Azov's avatar
Andrey Azov committed
31
import speciesPage from 'src/content/app/species/state/index';
32

33
const createRootReducer = (history: any) =>
34 35 36
  combineReducers({
    browser,
    drawer,
37
    customDownload,
38
    communication,
Andrey Azov's avatar
Andrey Azov committed
39
    ensObjects,
Andrey Azov's avatar
Andrey Azov committed
40
    inAppSearch,
41
    genome,
42 43 44
    global,
    header,
    router: connectRouter(history),
Andrey Azov's avatar
Andrey Azov committed
45
    speciesSelector,
Andrey Azov's avatar
Andrey Azov committed
46
    speciesPage,
Andrey Azov's avatar
Andrey Azov committed
47
    entityViewer
48 49
  });

50 51 52 53 54 55 56
export const createServerSideRootReducer = () =>
  combineReducers({
    speciesSelector,
    entityViewer
  });

export default createRootReducer;