Skip to content

Consider migrating to redux hooks and stop using connect #161

Open
@acelaya

Description

@acelaya

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions