Action handlers
ActionHandler
Array of actions, each action has id and options.
An array of actions, where each action includes:
- id: A unique identifier for the action.
- options: Defines properties based on type of action handler.
export type ActionHandler = {
actionId: `${ActionHandlerId}`;
options: CustomActionButtonOptions | FollowButtonOptions;
};
export type CustomActionButtonOptions = {
buttonName: string;
onClick: (e: MouseEvent | Event, data: ContentEntities | null) => void;
};
export type FollowButtonOptions = {
onClick: (e: MouseEvent | Event, data: FollowingSharedContext) => void;
};| Property | Type | Description |
|---|---|---|
ActionHandler | Object | Represents an action handler. |
actionId | ActionHandlerId | A unique identifier for the action. |
options | CustomActionButtonOptions | FollowButtonOptions | Defines action handler properties. |
| CustomActionButtonOptions | Object | Configuration for the action button. |
buttonName | string | The label displayed on the button. |
onClick | (e: MouseEvent | Event, data: ContentEntities | null) => void | Callback function triggered when the button is clicked. |
| FollowButtonOptions | Object | Configuration for the follow button. |
onClick | (e: MouseEvent | Event, data: FollowingSharedContext) => void | Callback function triggered when the follow button is clicked. |
| ActionHandlerId | Enum | Predefined action identifiers. |
AddCustomActionButton | 'addCustomActionButton' | Represents an action to add a custom button. |
AddFollowButton | 'addFollowButton' | Represents an action to add a follow button. Currently supported only for moments. |
Pass actionHandlers as part of IWidgetViewOptions when you create a widget, or to playContent. See BlazeSDK class.
Updated 16 days ago
Did this page help you?
