Skip to content

Commit

Permalink
Merge pull request #3004 from andrewbaldwin44/task/lib-create-store
Browse files Browse the repository at this point in the history
Add create store export
  • Loading branch information
cyberw authored Dec 2, 2024
2 parents 7b4bad7 + cca0275 commit 35b07bb
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 35b07bb

Please sign in to comment.