Clanbite JavaScript

wp.hooks.doAction( 'clanbite.notifications.polled', {{ transport: string, response: Object|null, payload: Object|null }} detail )

Fires after each successful notification poll (HTTP or WebSocket) so other UI can sync on the same cadence.

The Points companion also fires it with transport: 'synthetic' after it awards points for a button click.

Action JavaScript

Parameters

$detail ({{ transport: string, response: Object|null, payload: Object|null }})

transport is http, websocket or synthetic; response is the poll REST JSON for http; payload is the message for websocket.

Example

wp.hooks.addAction( 'clanbite.notifications.polled', 'my-plugin/handler', function ( detail ) {
} );

Defined in src/blocks/notifications/notification-bell/view.js

Changelog

VersionDescription
1.3.0Updated.