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

Consider migrating to redux hooks and stop using connect #161

Open
acelaya opened this issue Dec 15, 2023 · 0 comments
Open

Consider migrating to redux hooks and stop using connect #161

acelaya opened this issue Dec 15, 2023 · 0 comments
Labels
enhancement New feature or request thech-debt
Milestone

Comments

@acelaya
Copy link
Member

acelaya commented Dec 15, 2023

Even though I'm a big fan of dependency injection, doing it properly in a react with redux app has been challenging.

One of the things being currently handled by the dependency injection container are redux state and actions, which is done by converting components in services and decorating them with connect.

One way to avoid having to define full chains of components as injectable services would be moving to use redux hooks instead.

Try to migrate one reducer so that it exposes custom selector hooks and action hooks, and see how it feels.

Considerations:

  • Is testing going to become harder? With DI, it was easier to explicitly pass dependencies. With hooks, every component test will have to define a redux provider and create a store.
  • Should we define one hook per reducer module exposing its state? Another for all actions? One hook per action?
@acelaya acelaya added enhancement New feature or request thech-debt labels Dec 15, 2023
@acelaya acelaya added this to the 1.0.0 milestone Dec 15, 2023
@acelaya acelaya added this to Shlink Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request thech-debt
Projects
Status: No status
Development

No branches or pull requests

1 participant