Implement a simple pub/sub (useSubscription pattern)
Full Answer
Key Insight: This is the pattern behind useSyncExternalStore. React calls getSnapshot() to check if the value changed and subscribe() to register for future changes. External stores (Zustand, Redux) all implement this interface.