Skip to content

Commit

Permalink
Add create store export
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewbaldwin44 committed Dec 2, 2024
1 parent 7b4bad7 commit cca0275
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion locust/webui/src/lib.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export { default as Logo } from 'assets/Logo';
export { default as Modal } from 'components/Modal/Modal';
export { default as useCreateTheme } from 'hooks/useCreateTheme';
export { tabConfig } from 'components/Tabs/Tabs.constants';
export { store as locustStore } from 'redux/store';
export { store as locustStore, createStore as createLocustStore } from 'redux/store';
export { pushQuery } from 'utils/url';

export type { IRootState } from 'redux/store';
Expand Down
9 changes: 8 additions & 1 deletion locust/webui/src/redux/store.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
import { configureStore } from '@reduxjs/toolkit';

import { api } from 'redux/api/swarm';
import rootReducer from 'redux/slice/root.slice';
import rootReducer, { IRootState } from 'redux/slice/root.slice';

export const store = configureStore({
reducer: rootReducer,
middleware: getDefaultMiddleware => getDefaultMiddleware().concat(api.middleware),
});

export const createStore = (preloadedState: Partial<IRootState>) =>
configureStore({
reducer: rootReducer,
middleware: getDefaultMiddleware => getDefaultMiddleware().concat(api.middleware),
preloadedState,
});

export type { IRootState, Action } from 'redux/slice/root.slice';
export default configureStore;

0 comments on commit cca0275

Please sign in to comment.