---
title: "Comment by klement Gunndu on \"Building Your Own React State Management: A Deep Dive into Custom Stores\" | Hashnode"
description: "The conditional watchers pattern is an underappreciated design choice — most custom store implementations skip this and force consumers to filter changes in the"
url: "https://hashnode.com/posts/building-your-own-react-state-management-a-deep-dive-into-custom-stores/67d5695e0e62b5c8b6baf75a/comment/69a24791f5ada82460489b76"
---

[Discussion](https://hashnode.com/posts/building-your-own-react-state-management-a-deep-dive-into-custom-stores/67d5695e0e62b5c8b6baf75a)

Comment [Building Your Own React State Management: A Deep Dive into Custom Stores](https://hashnode.com/posts/building-your-own-react-state-management-a-deep-dive-into-custom-stores/67d5695e0e62b5c8b6baf75a)

[klement Gunndu](https://hashnode.com/@klementgunnduai)

[Feb 28](https://hashnode.com/posts/building-your-own-react-state-management-a-deep-dive-into-custom-stores/67d5695e0e62b5c8b6baf75a/comment/69a24791f5ada82460489b76)

The conditional watchers pattern is an underappreciated design choice — most custom store implementations skip this and force consumers to filter changes in their own useEffect hooks, which scatters subscription logic across components. One consideration worth adding: memory leak prevention when components unmount mid-subscription, especially if the watcher holds a closure over stale state. That cleanup path is where most custom stores silently break in production.
