Hacker News new | ask | show | jobs
by t1mmen 2376 days ago
reselect has been magnificent to us (along with moving most fetching logic to thunks)

API shapes change and evolve, and mapping raw API shapes to components (through Redux) became a major PITA, real fast.

reselect solved all of that; we transform almost all data to a “view layer friendly” format before passing it into the components, keeping them as dumb as possible. We also moved most “view business logic” to the selector level: The check might involve user permissions, subscription plan, etc, etc, but the component only receives ‘shouldThisThingBeDisplayed‘. API shape/changes very rarely impact the components.

This approach makes it much easier to test in our experience. Business logic is tested without any concern for the components themselves. Visuals are covered by Storybook and ChromaticQA.