redux#combineReducers JavaScript Examples

The following examples show how to use redux#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: comments.sagas.test.js    From horondi_admin with MIT License 6 votes vote down vote up
describe('handle comment saga error tests', () => {
  it('should handle comments error', () => {
    expectSaga(handleCommentsError, mockError)
      .withReducer(combineReducers({ commentsReducer, Snackbar }), {
        commentsReducer: {
          ...initialState,
          commentsLoading: true
        },
        Snackbar: mockSnackbarState
      })
      .put(setCommentsLoading(false))
      .put(setCommentError({ e: mockError }))
      .put(setSnackBarSeverity(snackBarError))
      .put(setSnackBarMessage(mockError.message))
      .put(setSnackBarStatus(true))
      .hasFinalState({
        commentsReducer: {
          ...initialState,
          commentsLoading: false,
          commentsError: { e: mockError }
        },
        Snackbar: {
          snackBarStatus: true,
          snackBarSeverity: snackBarError,
          snackBarMessage: mockError.message
        }
      })
      .run();
  });
});
Example #2
Source File: index.js    From ashteki with GNU Affero General Public License v3.0 6 votes vote down vote up
rootReducer = combineReducers({
    navigation,
    auth,
    cards,
    games,
    news,
    toastr: toastrReducer,
    api,
    admin,
    user,
    account,
    lobby,
    stats
})
Example #3
Source File: index.js    From Learning-Redux with MIT License 6 votes vote down vote up
pagination = combineReducers({
  starredByUser: paginate({
    mapActionToKey: (action) => action.login,
    types: [
      ActionTypes.STARRED_REQUEST,
      ActionTypes.STARRED_SUCCESS,
      ActionTypes.STARRED_FAILURE,
    ],
  }),
  stargazersByRepo: paginate({
    mapActionToKey: (action) => action.fullName,
    types: [
      ActionTypes.STARGAZERS_REQUEST,
      ActionTypes.STARGAZERS_SUCCESS,
      ActionTypes.STARGAZERS_FAILURE,
    ],
  }),
})
Example #4
Source File: mainReducer.js    From forge-configurator-inventor with MIT License 6 votes vote down vote up
mainReducer = combineReducers({
    projectList: projectListReducer,
    notifications: notificationReducer,
    parameters: parametersReducer,
    updateParameters: updateParametersReducer,
    uiFlags: uiFlagsReducer,
    profile: profileReducer,
    bom: bomReducer
})
Example #5
Source File: constructor-page.variables.js    From horondi_admin with MIT License 6 votes vote down vote up
store = createStore(
  combineReducers({
    Material: (_state = [], _action = '') => material,
    Model: (_state = [], _action = '') => model,
    Pattern: (_state = [], _action = '') => pattern,
    Constructor: (_state = [], _action = '') => constructor,
    Table: (_state = [], _action = '') => table
  })
)
Example #6
Source File: app.spec.js    From full-stack-fastapi-react-postgres-boilerplate with MIT License 6 votes vote down vote up
describe('app', () => {
  it('should have the expected watchers', done =>
    expectSaga(app)
      .run({ silenceTimeout: true })
      .then(saga => {
        expect(saga).toMatchSnapshot();
        done();
      }));

  it('should have the switch menu saga', () =>
    expectSaga(switchMenu, { payload: { query: 'react' } })
      .withReducer(combineReducers({ ...rootReducer }))
      .put({
        type: ActionTypes.GITHUB_GET_REPOS,
        payload: { query: 'react' },
      })
      .run());
});
Example #7
Source File: RideRequest.spec.js    From carpal-fe with MIT License 6 votes vote down vote up
//mock redux

function renderWithRedux(
    ui,
    {
        store = createStore(
            combineReducers({
                user: reducer
            }),
            applyMiddleware(thunk, logger)
        )
    } = {}
) {
    
    return {
        ...render(<Provider store={store}>{<Router>{ui}</Router>}</Provider>),
        store
    };
}
Example #8
Source File: index.js    From win11React with Creative Commons Zero v1.0 Universal 6 votes vote down vote up
allReducers = combineReducers({
  wallpaper: wallReducer,
  taskbar: taskReducer,
  desktop: deskReducer,
  startmenu: menuReducer,
  sidepane: paneReducer,
  widpane: widReducer,
  apps: appReducer,
  menus: menusReducer,
  globals: globalReducer,
  setting: settReducer,
  files: fileReducer
})
Example #9
Source File: index.js    From Learning-Redux with MIT License 6 votes vote down vote up
appReducer = combineReducers({
  users: usersReducer,
  posts: postsReducer,
  filter: filterReducer,
  loading: loadingReducer,
  error: errorReducer,
  session: sessionReducer,
  route: routerReducer,
})
Example #10
Source File: index.js    From shopping-cart-fe with MIT License 6 votes vote down vote up
rootReducer = combineReducers({
	form: formReducer,
	user: userReducer,
	store: storeReducer,
	cart: cartReducer,
	search: searchReducer,
	savedCart: savedCartReducer,
	dashboard: dashboardReducer,
	order: orderReducer,
	product: productReducer,
	orders: getOrdersReducer,
	onboard: onboardReducer,
	logo: logoReducer,
	color: colorReducer
})
Example #11
Source File: index.js    From bonded-stablecoin-ui with MIT License 6 votes vote down vote up
rootReducer = combineReducers({
  settings: settingsReducer,
  list: listReducer,
  active: activeReducer,
  pendings: pendingsReducer,
  connected: connectionReducer,
  data: dataReducer,
  carburetor: carburetorReducer,
  symbols: symbolsReducer,
  prices: pricesReducer,
  tracked: trackedReducer
})
Example #12
Source File: store.js    From create-sas-app with Apache License 2.0 6 votes vote down vote up
reducer = combineReducers({
	home: homeReducer,
	login: loginReducer,
	adapter: adapterReducer,
	header: headerReducer,
	projectList: projectListReducer,
	newProject: newProjectReducer,
	customAlert: customAlertReducer,
	project: projectReducer,
})
Example #13
Source File: index.js    From Alfredo-Mobile with MIT License 6 votes vote down vote up
reducers = combineReducers({
  nav: require('./NavigationRedux').reducer,
  products: require('./ProductsRedux').reducer,
  category: require('./CategoryRedux').reducer,
  auth: require('./AuthRedux').reducer,
  session: require('./SessionRedux').reducer,
  invoice: require('./InvoiceRedux').reducer,
  order: require('./OrderRedux').reducer,
  confirm: require('./ConfirmPaymentRedux').reducer,
})
Example #14
Source File: store.js    From management-center with Apache License 2.0 6 votes vote down vote up
store = createStore(
	combineReducers({
		brokerConfigurations: brokerConfigurationsReducer,
		brokerConnections: brokerConnectionsReducer,
		proxyConnection: proxyConnectionReducer,
		groups: groupsReducer,
		license: licenseReducer,
		version: versionsReducer,
		roles: rolesReducer,
		settings: settingsReducer,
		webSocketConnections: webSocketConnectionsReducer,
		streams: streamsReducer,
		systemStatus: systemStatusReducer,
		topicTree: topicTreeReducer,
		clients: clientsReducer,
		userRoles: userRolesReducer,
		userProfile: userProfileReducer,
		users: usersReducer,
		clusters: clustersReducer,
		inspectClients: inspectClientsReducer,
		brokerLicense: brokerLicenseReducer,
		tests: testsReducer,
		// bridges: bridgesReducer
	})
)
Example #15
Source File: reducers.js    From e-Pola with MIT License 6 votes vote down vote up
export function makeRootReducer(asyncReducers) {
  return combineReducers({
    // Add sync reducers here
    firebase,
    firestore,
    notifications,
    location: locationReducer,
    ...asyncReducers
  })
}
Example #16
Source File: index.js    From airdnd-frontend with MIT License 6 votes vote down vote up
rootReducer = combineReducers({
  user,
  signup,
  login,
  search,
  searchForm,
  wishlists,
  trips,
  message,
  home,
  modal,
  map,
  reservation,
  socket,
  mouseEvents,
})
Example #17
Source File: index.js    From Designer-Client with GNU General Public License v3.0 6 votes vote down vote up
rootReducer = combineReducers({
  users,
  alerts,
  apis,
  metas,
  operations,
  resources,
  applications
})
Example #18
Source File: reducers.js    From substrate-authn-faucet-frontend with GNU General Public License v3.0 6 votes vote down vote up
createReducer = history => {
  return combineReducers({
    router: connectRouter(history),
    signupReducer,
    browser: createResponsiveStateReducer({
      mobile: 320,
      tablet: 768,
      desktop: 1024
    })
  });
}
Example #19
Source File: index.js    From react-native-todolist with MIT License 6 votes vote down vote up
rootReducer = combineReducers({
    actionType: actionTypeReducer,
    plannerList: fetchPlannerReducer,
    appLoginPayload: appLoginReducer,
    addPlannerPayload: addPlannerReducer,
    firebasePlannerList: fetchFirebasePlannerReducer,
    googlePlannerList: fetchGoogleCalendarReducer,
    microsoftPlannerList: fetchMicrosoftPlannerReducer,
    fetchStudentsListPayload: fetchStudentsListReducer,
    loadFBAnnoucements: fetchFBAnnouncementReducer,
    fetchAnnouncementPayload: fetchAnnouncementReducer,
    grantDrivePermissionState: grantGoogleDrivePermissionReducer,
    uploadDriveAttachment: uploadFilesGoogleDriveReducer,
    plannerCallback: createPlannerReducer,
    createFirebasePlannerPayload: createFirebasePlannerReducer,
    createGooglePlannerPayload: createGooglePlannerReducer,
    createMicrosoftPlannerPayload: createMicrosoftPlannerReducer,
})
Example #20
Source File: index.js    From Spoke with MIT License 6 votes vote down vote up
constructor(history, initialState = {}) {
    const reducer = combineReducers({
      ...reducers,
      apollo: ApolloClientSingleton.reducer(),
      routing: routerReducer
    });

    this.data = createStore(
      reducer,
      initialState,
      compose(
        applyMiddleware(
          routerMiddleware(history),
          ApolloClientSingleton.middleware(),
          ReduxThunk.withExtraArgument(ApolloClientSingleton)
        ),
        typeof window === "object" &&
          typeof window.devToolsExtension !== "undefined"
          ? window.devToolsExtension()
          : f => f
      )
    );
  }
Example #21
Source File: index.js    From Artion-Client with GNU General Public License v3.0 6 votes vote down vote up
rootReducer = combineReducers({
  Auth,
  ConnectWallet,
  HeaderOptions,
  Modal,
  Filter,
  Collections,
  Tokens,
  Price,
})
Example #22
Source File: configureStore.js    From HexactaLabs-NetCore_React-Initial with Apache License 2.0 6 votes vote down vote up
export default function configureStore(history, initialState) {
  const reducers = {
    form: formReducer,
    router: connectRouter(history),
    auth,
    home,
    provider,
    store
  };

  const middleware = [thunk, routerMiddleware(history)];

  const enhancers = [];
  // eslint-disable-next-line no-undef
  const isDevelopment = process.env.NODE_ENV === "development";

  if (
    isDevelopment &&
    typeof window !== "undefined" &&
    window.devToolsExtension
  ) {
    enhancers.push(window.devToolsExtension());
  }

  const rootReducer = combineReducers(reducers);

  return createStore(
    rootReducer,
    initialState,
    compose(
      applyMiddleware(...middleware),
      ...enhancers
    )
  );
}
Example #23
Source File: configureStore.js    From flame-coach-web with MIT License 6 votes vote down vote up
makeStore = () => {
  const isServer = typeof window === 'undefined';

  if (isServer) {
    return createOwnStore(rootReducer);
  }

  const rootReducers = combineReducers({
    notification: notificationReducer
  });
  return createOwnStore(rootReducers);

}
Example #24
Source File: index.js    From college-management-react with GNU General Public License v3.0 6 votes vote down vote up
rootReducer = combineReducers({
  
  // INSERT HERE YOUR CUSTOM REDUCERS
  LoginReducer,
  ProfileReducer,
  UserEditReducer,
  UserListReducer,

  // START COMBINE REDUCERS
	HomeReducer,
	CourseEditReducer,
	CourseListReducer,
	ExamEditReducer,
	ExamListReducer,
	StudentEditReducer,
	StudentListReducer,
	TeacherEditReducer,
	TeacherListReducer,
 // END COMBINE REDUCERS

})
Example #25
Source File: monsterReducer.js    From codeclannigeria-frontend with MIT License 6 votes vote down vote up
MonsterReducer = combineReducers({
  auth: AuthReducer,
  courses: CoursesReducer,
  tracks: TracksReducer,
  user: UserReducer,
  tasks: TaskReducer,
  stages: StagesReducer,
  API: APIReducer,
})
Example #26
Source File: index.js    From Learning-Redux with MIT License 6 votes vote down vote up
pagination = combineReducers({
  starredByUser: paginate({
    mapActionToKey: (action) => action.login,
    types: [
      ActionTypes.STARRED_REQUEST,
      ActionTypes.STARRED_SUCCESS,
      ActionTypes.STARRED_FAILURE,
    ],
  }),
  stargazersByRepo: paginate({
    mapActionToKey: (action) => action.fullName,
    types: [
      ActionTypes.STARGAZERS_REQUEST,
      ActionTypes.STARGAZERS_SUCCESS,
      ActionTypes.STARGAZERS_FAILURE,
    ],
  }),
})
Example #27
Source File: reducers.js    From QiskitFlow with Apache License 2.0 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({
    global: globalReducer,
    language: languageProviderReducer,
    router: connectRouter(history),
    ...injectedReducers,
  });

  return rootReducer;
}
Example #28
Source File: rootReducer.js    From NoteMaster with GNU General Public License v3.0 6 votes vote down vote up
// Root reducer
export default function createRootReducer(history: HashHistory) {
  return combineReducers<{}, *>({
    router: connectRouter(history),
    window: windowReducer,
    monaco: monacoReducer,
    preferences: preferencesReducer,
    contextEvaluation: contextEvaluationReducer
  });
}
Example #29
Source File: index.js    From dexwebapp with Apache License 2.0 6 votes vote down vote up
rootReducer = (history) =>
  combineReducers({
    router: connectRouter(history),
    exchange: ExchangeInfoReducer,
    tabs: TabsReducer,
    tradePanel: TradePanelReducer,
    layoutManager: LayoutManagerReducer,
    liquidityMining: LiquidityMiningReducer,
    currentMarket: CurrentMarketReducer,
    orderBook: OrderBookReducer,
    tradeHistory: TradeHistoryReducer,
    ticker: TickerReducer,
    modalManager: ModalManagerReducer,
    balances: MyAccountPageReducer,
    myOrders: MyOrdersReducer,
    myOrderPage: MyOrderPageReducer,
    metaMask: MetaMaskReducer,
    walletConnect: WalletConnectReducer,
    walletLink: WalletLinkReducer,
    mewConnect: MewConnectReducer,
    authereum: AuthereumReducer,
    dexAccount: DexAccountReducer,
    nonce: NonceReducer,
    gasPrice: GasPriceReducer,
    legalPrice: LegalPriceReducer,
    commissionReward: CommissionRewardReducer,
    userPreferences: UserPreferenceManagerReducer,
    notifyCenter: NotifyCenterReducer,
  })