@reduxjs/toolkit#combineReducers JavaScript Examples

The following examples show how to use @reduxjs/toolkit#combineReducers. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: rootReducer.js    From juggernaut-desktop with MIT License 6 votes vote down vote up
export default function createRootReducer(history) {
  return combineReducers({
    router: connectRouter(history),
    wallets: walletsReducer,
    conversations: conversationsReducer,
    messages: messagesReducer,
    wallet: walletReducer,
    channels: channelsReducer,
    transactions: transactionsReducer,
    peers: peersReducer,
    nodes: nodesReducer,
    chat: chatReducer,
    app: appReducer
  });
}
Example #2
Source File: index.js    From simplQ-frontend with GNU General Public License v3.0 6 votes vote down vote up
rootReducer = combineReducers({
  appReducer,
  queues: queuesReducer,
  tokens: tokensReducer,
  queueInfo: queueInfoReducer,
  token: tokenReducer,
  actionStatus: actionStatusReducer,
  selectedQueue: selectedQueueReducer,
  selectedQueueHistory: selectedQueueHistoryReducer,
})
Example #3
Source File: rootReducer.js    From dashboard-for-socialmedia-trend with MIT License 6 votes vote down vote up
rootReducer = combineReducers({
  categories: categoriesReducer,
  countries: countriesReducer,
  count: countReducer,
  session: sessionReducer,
  toaster: toasterReducer,
  tweets: tweetsReducer,
  hashtags: hashtagsReducer,
})
Example #4
Source File: reducers.js    From rtk-demo with MIT License 6 votes vote down vote up
/**
 * Merges the main reducer with the router state and dynamically injected reducers
 */
export default function createReducer(injectedReducers = {}) {
  const rootReducer = combineReducers({
    language: languageProviderReducer,
    ...injectedReducers,
  });

  return rootReducer;
}
Example #5
Source File: store.js    From genshin with MIT License 5 votes vote down vote up
rootReducer = combineReducers({
  app: appSlice.reducer,
  news: newsSlice.reducer,
  indispensable: indispensableSlice.reducer,
  dailies: dailiesSlice.reducer,
  article: articleSlice.reducer,
})
Example #6
Source File: rootReducer.js    From saasgear with MIT License 5 votes vote down vote up
rootReducer = combineReducers({
  user: userSlice,
  userPlan: userPlanSlice,
  team: teamSlice,
  sidebar: sidebarSlice,
})
Example #7
Source File: index.js    From discovery-mobile-ui with MIT License 5 votes vote down vote up
createStore = (authentication) => {
  const { baseUrl, tokenResponse: { accessToken, idToken } } = authentication;

  const fhirClient = new FhirClient(baseUrl, accessToken, idToken);

  const epicMiddleware = createEpicMiddleware({
    dependencies: {
      fhirClient,
    },
  });

  const { patientId } = fhirClient;

  const rootReducer = combineReducers({
    resources: flattenedResourcesReducer,
    associations: associationsReducer,
    activeCollectionId: activeCollectionIdReducer,
    collections: collectionsReducer,
    creatingCollection: isCreatingNewCollectionReducer,
  });

  const persistReducerConfig = {
    version: '0.1.0',
    key: `root-${patientId}`,
    storage: AsyncStorage,
    whitelist: ['activeCollectionId', 'collections', 'creatingCollection'],
  };

  const store = configureStore({
    reducer: persistReducer(persistReducerConfig, rootReducer),
    middleware: compose([
      thunk,
      epicMiddleware,
      // routerMiddleware(history), // < e.g.: other middleware
    ]),
    devTools: {
      serialize: true, // See: https://github.com/zalmoxisus/redux-devtools-extension/blob/master/docs/API/Arguments.md#serialize
    },
  });

  epicMiddleware.run(rootEpic);

  const callback = () => {
    // callback function will be called after rehydration is finished.
  };

  const persistConfig = {
    // manualPersist: true,
  };

  const persistor = persistStore(store, persistConfig, callback);

  return {
    store,
    persistor,
  };
}
Example #8
Source File: combineReducers.jsx    From ResoBin with MIT License 5 votes vote down vote up
reducer = combineReducers({
  auth: authReducer,
  course: courseReducer,
  settings: settingsReducer,
  user: userReducer,
})