Skip to content

chore: redux setup - #10

Merged
Abviol merged 11 commits into
devfrom
chore/setup-redux
Jul 6, 2026
Merged

chore: redux setup#10
Abviol merged 11 commits into
devfrom
chore/setup-redux

Conversation

@Abviol

@Abviol Abviol commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Description

The purpose of the PR is setting up the Redux Toolkit along with Next.js v16 and creating a usage example which may and will be used as a base for future development of Redux slices and reducers and their integration in the UI. In particular, the next PR will be dedicated to the development of the cartSlice and reducers for updating the state and providing a global storage for the CartPage and the CartDrawer which will share the content.

Changes

  • Installed the @reduxjs/toolkit and react-redux Redux packages as dev dependencies for its future integration in Next.js,
  • Configured Redux store Following the official "Redux Toolkit Setup with Next.js" documentation https://redux-toolkit.js.org/usage/nextjs,
  • Configured Redux hooks with types for correct integration of the library in React/Next.js with TypeScript environment following the official documentation,
  • Created a StoreProvider component following the official documentation,
  • Wrapped the RootLayout component in StoreProvider to integrateRedux into UI,
  • Created a redux demo for checking the correct library setup and providing a base for future development:
    • Created a counterSlice with its reducers, selectors and actions in lib/features/counter,
    • Created an api endpoint for the demo in app/api/counter/route.ts,
    • Added Redux demo UI in app/demo/page.tsx,

Screenshots

image

Testing

  • Controlled the absence of any errors in terminal.
  • Controlled the absence of ESLint errors.
  • Interacted with the Redux Demo UI to check the logic works as intended.

Checklist

  • Tested locally
  • No ESLint errors
  • No console errors
  • No new accessibility violations
  • Types are correct
  • Documentation/comments updated

Abviol added 9 commits July 6, 2026 16:15
Install the @reduxjs/toolkit and 
eact-redux Redux packages as dev dependencies

for its future integration in Next.js
Following the official documentation 'Redux Toolkit Setup with Next.js'

https://redux-toolkit.js.org/usage/nextjs
Configure with types useAppDispatch, useAppSelector, and useAppStor

following the official documentation 'Redux Toolkit Setup with Next.js'

https://redux-toolkit.js.org/usage/nextjs#caching
Create a StoreProvider component following the official Redux Toolkit Setup with Next.js

documentation https://redux-toolkit.js.org/usage/nextjs#caching
Provide the Redux store to the main layout of the app
- lib/features/counter/counterSlice.ts: configure counter slice with its reducers, selectors
and actions;
- lib/features/counter/counterAPI.ts: an mock API-request function for demo;
- lib/createAppSlice.ts: function for creating slices with async thunks;
- lib/store.ts: set the reducer to rootReducer, update RootState to be type of rootReducer
- app/api/counter/route.ts: api endpoint for the demo
- app/demo/page.tsx: redux demo UI
- app/demo/demo.module.css: stylings for the redux demo UI
Configure listeners using the provided defaults. Optional, but
required for `refetchOnFocus`/`refetchOnReconnect` behaviors
Reformat to follow the Code Conventions.
@Abviol Abviol added the enhancement New feature or request label Jul 6, 2026
@vercel

vercel Bot commented Jul 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
scent Ready Ready Preview, Comment Jul 6, 2026 8:24pm

Abviol added 2 commits July 6, 2026 22:21
Remove the second param `context` of the `POST` function to eliminate
a TypeScript error as its not even used.
@Abviol
Abviol merged commit 4a97b21 into dev Jul 6, 2026
3 checks passed
@Abviol
Abviol deleted the chore/setup-redux branch July 7, 2026 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant