Flarum (2.x)
    Preparing search index...

    JS extender for integrating with flarum/realtime.

    Use this in your extension's extend.ts, guarded by an extension check:

    import { RealtimeExtend } from 'flarum/realtime/forum';

    export default [
    ...('flarum-realtime' in flarum.extensions
    ? [
    new RealtimeExtend()
    .onDiscussionStreamEvent('likesMutation'),
    ]
    : []),
    ];

    The guard is necessary because this module will not be available when flarum/realtime is not installed.

    Implements

    Index

    Constructors

    Methods

    • 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).

      Parameters

      • eventName: string

        The Pusher event name, e.g. 'likesMutation'.

      Returns this