DEV Community

Luis Cruz
Luis Cruz

Posted on

A Thought-Provoking Approach to Frontend State Architecture

I just read “There's an Entity for That” by Matteo Antony Mistretta, and I think it's worth sharing with other frontend developers interested in state management and architecture.

One idea that stood out to me is treating stateful browser capabilities as entities with their own lifecycle, rather than scattering subscriptions and cleanup across components and hooks.

The examples around Geolocation, Compass, NetworkStatus, PageVisibility, and MediaQuery make the architectural idea particularly interesting.

What I especially liked is that the article doesn't present entities as a universal replacement for hooks or Redux. It clearly explains the trade-offs and focuses on having one event model and one testing approach across different parts of an application.

If you're working with JavaScript, React, Redux, state management, or frontend architecture, I recommend giving this one a read.

👉 Original article:
https://dev.to/iceonfire/theres-an-entity-for-that-4ifm

Top comments (1)

Collapse
 
iceonfire profile image
Matteo Antony Mistretta

Thank you so much for you feedback, I really appreciate it!