feat(iii-browser): expose addConnectionStateListener on ISdk#1611
feat(iii-browser): expose addConnectionStateListener on ISdk#1611
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe SDK adds a ChangesConnection State Listener
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
addConnectionStateListener(handler)to theISdkpublic interfaceIIIConnectionStatetype from package rootWhy
Consumers of
iii-browser-sdkneed an observable connection state to drive WS-based UI. TodaysetConnectionStateis private andIIIConnectionStateisn't exported, so consumers have no way to read or react to connection transitions (connect / disconnect / reconnect / failed).Test plan
tests/connection.test.tscovering subscribe / unsubscribe / multi-listener / initial-fire / connecting->connected transitionpnpm buildsucceeds (tsdown)Summary by CodeRabbit
New Features
addConnectionStateListenermethod enabling developers to monitor WebSocket connection-state transitions. Listeners are invoked immediately with the current state and on subsequent changes, with built-in unsubscribe functionality.Tests