Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Redux with zustand #27

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

Brunonascdev
Copy link
Contributor

@Brunonascdev Brunonascdev commented Mar 6, 2025

This PR replaces our previous Redux-based state management with zustand, a lightweight, hook-based state-management library that reduces boilerplate and improves performance.

Rationale

We have some benefits to switching from Redux to zustand:

  • Less Boilerplate: zustand’s hook-based API streamlines state management, eliminating much of the verbose configuration required by Redux.
  • Performance Gains: The design of zustand allows for more efficient state updates, which can lead to better performance, especially in larger applications.
  • Scalability and Simplicity: zustand offers a simple yet powerful way to manage state, making it easier to maintain and scale as our application grows.

Docs: https://zustand.docs.pmnd.rs/getting-started/introduction

@Brunonascdev Brunonascdev added the enhancement New feature or request label Mar 6, 2025
@Brunonascdev Brunonascdev self-assigned this Mar 6, 2025
@CassioMG
Copy link
Contributor

CassioMG commented Mar 6, 2025

In addition to that, we have the laboratory team using zustand for about a year now and they appear to like it:
stellar/laboratory#741
stellar/laboratory#1253

@CassioMG CassioMG requested a review from piyalbasu March 6, 2025 20:41
}),
);
setNetworkInfo({
isConnected: state.isConnected,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know it was already there, but could we rename state to event or something else here? just to make it 100% clear it has nothing to do with store state - thanks!

Copy link
Contributor

@CassioMG CassioMG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Just left a suggestion regarding a param name

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.

3 participants