Bind a callback to an event on both the public and user channels.
The Pusher event name.
Called with the event payload when the event fires.
Register a Pusher event name that should trigger a discussion stream reload on the currently open DiscussionPage.
The event is bound on both the public and user channels. When received, DiscussionPage reloads the post stream so the UI reflects the change (e.g. a post being liked, locked, voted on).
The Pusher event name, e.g. 'likesMutation'.
Bind a callback to an event on the public channel.
The Pusher event name.
Called with the event payload when the event fires.
Bind a callback to an event on the user's private channel.
The Pusher event name.
Called with the event payload when the event fires.
JS extender for integrating with flarum/realtime.
Use this in your extension's
extend.ts, guarded by an extension check:The guard is necessary because this module will not be available when flarum/realtime is not installed.