chanzuckerberg / single-cell-data-portal

The data portal supporting the submission, exploration, and management of projects and datasets to cellxgene.
MIT License
64 stars 14 forks source link

Use Redux Toolkit #5826

Open tihuan opened 1 year ago

tihuan commented 1 year ago
  1. WMG's state management is now sufficiently complex that engineers can no longer track the data flow in their heads. I think it's time to introduce RTK!
  2. Benefits:
    1. Most popular state management library that most React engineers know how to use and it's great for managing complex FE state.
    2. It helps cuts down boilerplate code that we currently have in the code base from using React hooks such as useReducer directly. It is recommended to not use RTK when the state is simple, but we've now outgrown that phase
    3. RTK already comes with Chrome extension for easy debugging
    4. Standardized data flow means we can leverage existing Redux ecosystem and libraries to solve problems we run into in the future
  3. Effort: Probably 3 to 4 days to set up the library and migrate existing state to use the reducer, and a day or two to test WMG thoroughly
tihuan commented 1 year ago

@seve thought you'd be excited for this 😆!

tihuan commented 1 year ago
  1. Add why RKT now
  2. Values
  3. Efforts
tihuan commented 1 year ago

@dsadgat just updated the description! Thank you!