Skip to content

Conversation

@dhuebner
Copy link
Member

@dhuebner dhuebner commented Jan 12, 2026

  • BREAKING: onRequest() and onNotification() now return Disposable instead of Messenger - This change removes method chaining but provides consistent disposal pattern
    • onRequest<P, R>(type: RequestType<P, R>, handler: RequestHandler<P, R>): Disposable
    • onNotification<P>(type: NotificationType<P>, handler: NotificationHandler<P>): Disposable
    • Migration: Replace method chaining like messenger.onRequest(type, handler).start() with separate calls: messenger.onRequest(type, handler); messenger.start();
  • BREAKING: Removed onRequestDisposable() and onNotificationDisposable() methods - These are no longer needed since onRequest() and onNotification() now return disposables directly

New Features

  • NEW: unregisterHandler(method: string): boolean - Programmatically unregister message handlers by method name
    • Returns true if handler was successfully removed, false if no handler existed
    • Enables dynamic handler management and cleanup

See #51

@dhuebner dhuebner requested a review from spoenemann January 12, 2026 15:55
@dhuebner dhuebner force-pushed the dhuebner/webview-unregister-51 branch from 7744bbf to 9f14c9e Compare January 12, 2026 16:23
Copy link
Member

@spoenemann spoenemann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks.

@dhuebner dhuebner force-pushed the dhuebner/webview-unregister-51 branch from 9f14c9e to 2144c56 Compare January 15, 2026 14:34
@dhuebner dhuebner merged commit aea0a84 into main Jan 15, 2026
1 check passed
@dhuebner dhuebner deleted the dhuebner/webview-unregister-51 branch January 15, 2026 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants