Context
Discovered during development of the showcase example (PR #252).
Problem
EnhancedAuthClient exposes subscribe and getSnapshot methods (compatible with React's useSyncExternalStore), but no existing example or README mentions this pattern. Without it, components only re-render via useAsyncCallback loading-state changes, which is fragile for multi-component layouts — auth state changes may not propagate correctly.
Impact
Consumers are unaware of the recommended pattern for subscribing to auth state in multi-component layouts, which can lead to subtle UI bugs where components don't re-render on auth state changes.
Proposed Action
- Add a usage example of
useSyncExternalStore with EnhancedAuthClient to the core library README.md.
- Consider adding a dedicated section in the docs covering reactive auth state consumption patterns.
Context
Discovered during development of the showcase example (PR #252).
Problem
EnhancedAuthClientexposessubscribeandgetSnapshotmethods (compatible with React'suseSyncExternalStore), but no existing example or README mentions this pattern. Without it, components only re-render viauseAsyncCallbackloading-state changes, which is fragile for multi-component layouts — auth state changes may not propagate correctly.Impact
Consumers are unaware of the recommended pattern for subscribing to auth state in multi-component layouts, which can lead to subtle UI bugs where components don't re-render on auth state changes.
Proposed Action
useSyncExternalStorewithEnhancedAuthClientto the core libraryREADME.md.