Skip to content

🧸 Zustand and Tanstack Query#96

Merged
rishighan merged 28 commits intomainfrom
zustand-react-query-navbar
Nov 29, 2023
Merged

🧸 Zustand and Tanstack Query#96
rishighan merged 28 commits intomainfrom
zustand-react-query-navbar

Conversation

@rishighan
Copy link
Copy Markdown
Owner

What?

This PR introduces a new way of thinking about client-state and global state.
To that end, I have begun switching from the react-redux state management library to a more deliberate dichotomy:

  1. UI that relies on data coming from an external source (API, endpoint etc.)
  2. UI that needs a slice of state, all across, at any given time

These two use cases have documented, well-researched and recommended approaches, which boils down to:

  1. @tanstack/react-query for syncing with external data sources
  2. zustand for global state management

Why?

Simply put, Redux relies on a lot of boilerplate, actions, reducers, dispatchers, action-types for every single piece of state that I want to surface in the UI. This grew untenable, and I refuse to write more code than I need to. I love deleting code, and this aligns well with that objective.

How?

To begin with, I have already introduced react-query and zustand in #95 and this PR will cover the refactor of the navbar and gradually move to other pages, in incremental PRs.

@rishighan rishighan self-assigned this Nov 7, 2023
@rishighan rishighan added this to the Dot Release milestone Nov 7, 2023
@rishighan rishighan merged commit dba520b into main Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AirDC++ socket connection errors are not surfaced

1 participant