Building it yourself first is genuinely the best way to understand why Zustand or Jotai make the tradeoffs they do. The point about performance optimization and having precise control over rendering behaviour is one that gets overlooked when you just reach for the popular library without questioning it.
Thanks for the great article and discussion about how one may implement their own state management in React!
klement Gunndu
Agentic AI Wizard
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.