Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compose: recompose or redux

Tags:

reactjs

redux

I have a React application which also uses Recompose and Redux.

Both of them has a compose function with very similar content:

  • Compose from Redux
  • Compose from Recompose

As far as they both do the same, I'd like to have only one module in my bundle.

Is there any known possible issue if I would like to use compose from redux to compose high order components from recompose?

like image 297
just-boris Avatar asked Dec 25 '22 01:12

just-boris


1 Answers

Semantically, they're both absolutely the same. But don't do it.


I would argue against replacing one's library function with another. Let's say you use redux's compose instead of recompose's compose.

  1. If the author of recompose updates his compose function and is different from redux, you lose.

  2. If the author of redux updates his compose and it is not compatible with recompose, you lose.

  3. If you decide to get rid of redux or recompose, you lose.

I would rather have more modules and keep my libraries decoupled.

like image 144
Lyubomir Avatar answered Feb 24 '23 17:02

Lyubomir