-
Notifications
You must be signed in to change notification settings - Fork 3
docs: useSyncExternalStore pattern undocumented for consumers #255
Copy link
Copy link
Open
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation
Description
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
useSyncExternalStorewithEnhancedAuthClientto the core libraryREADME.md. - Consider adding a dedicated section in the docs covering reactive auth state consumption patterns.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation