Welcome to the svlete-redux
repository, a showcase project demonstrating the seamless integration of Svelte with Redux Toolkit for efficient and modern state management. 🛠️
This project serves as an illustrative example of combining Redux Toolkit with Svelte to construct reactive and scalable web applications. It provides insights into handling both local and global state management effectively within a Svelte environment. 🚀
useSelector
implementation to connect Svelte components with the Redux store.The project is organized as follows:
src
: Contains the application's source code../
: Svelte components../lib/store
: Redux logic, including actions, reducers, and store configuration.public
: Static files for the application.To get started with this project, follow these steps:
Clone the Repository:
git clone https://github.com/ismadot/svlete-redux.git
Install Dependencies:
npm install
Run the Project:
npm run dev
The Redux store in this project is set up to manage global application state. Here's a breakdown of its configuration:
Actions (appActions.ts): Define various actions like addPlus, addMinus, and setUsername for updating the state.
Reducers (appReducer.ts): Handle state changes in response to dispatched actions. This includes incrementing/decrementing a counter and setting a username.
Store (config.ts): Combines reducers using combineReducers and configures the store with configureStore. Additionally, integrates with Svelte's reactive system using a custom bindReduxStore function, allowing Svelte components to subscribe to Redux state updates.
A special thanks to Sony AK for his insightful blog post on using Redux with Svelte and SvelteKit. His clear explanations and practical examples have been a valuable resource in the development of this project. Be sure to check out his work on GitHub for more amazing contributions to the open-source community. Thank you, Sony, for your inspiring work!
Contributions are welcome! If you have any ideas or proposals to enhance this project, feel free to open an issue or submit a pull request. 🙌
This project is licensed under the MIT License. Feel free to use, study, modify, and distribute it.