Skip to content

Commit

Permalink
Upgrading to use redux saga with redux toolkit
Browse files Browse the repository at this point in the history
  • Loading branch information
samilabud committed Mar 8, 2024
1 parent 072002b commit c86b212
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 2 deletions.
51 changes: 51 additions & 0 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"dependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@babel/plugin-transform-private-property-in-object": "^7.23.4",
"@reduxjs/toolkit": "^2.2.1",
"@stripe/react-stripe-js": "^1.7.0",
"@stripe/stripe-js": "^1.25.0",
"@testing-library/jest-dom": "^5.11.4",
Expand Down
7 changes: 5 additions & 2 deletions client/src/redux/store.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createStore, applyMiddleware } from "redux";
import { configureStore, Tuple } from "@reduxjs/toolkit";
import logger from "redux-logger";
import { persistStore } from "redux-persist";
import createSagaMiddleWare from "redux-saga";
Expand All @@ -14,7 +14,10 @@ if (process.env.NODE_ENV !== "production") {
middlewares.push(logger);
}

export const store = createStore(rootReducer, applyMiddleware(...middlewares));
export const store = configureStore({
reducer: rootReducer,
middleware: () => middlewares,
});

sagaMiddleWare.run(rootSaga);

Expand Down

0 comments on commit c86b212

Please sign in to comment.